libMesh::OFStream Class Reference

#include <o_f_stream.h>

List of all members.

Public Types

typedef std::string::size_type sizetype

Public Member Functions

 OFStream ()
 ~OFStream ()
template<typename T >
OFStreamscientific (const sizetype w, const T r)
template<>
OFStreamscientific (const sizetype w, const Complex r)

Detailed Description

This class provides a compatibility class for broken features in the std::ofstream of the older GCC versions. Other compilers do not see this class.

Definition at line 108 of file o_f_stream.h.


Member Typedef Documentation

typedef std::string::size_type libMesh::OFStream::sizetype

convenient typedef

Definition at line 130 of file o_f_stream.h.


Constructor & Destructor Documentation

libMesh::OFStream::OFStream (  )  [inline]

Default constructor.

Definition at line 115 of file o_f_stream.h.

00116    {
00117      // [JWP] TODO: I will remove this class at the next libmesh
00118      // release or on on March 21, 2013, whichever comes first.
00119      libmesh_deprecated();
00120    }

libMesh::OFStream::~OFStream (  )  [inline]

Default destructor.

Definition at line 125 of file o_f_stream.h.

00125 {}


Member Function Documentation

template<>
OFStream& libMesh::OFStream::scientific ( const sizetype  w,
const Complex  r 
) [inline]

Definition at line 58 of file o_f_stream.C.

00060 {
00061   libmesh_assert_less (w, 30);
00062   char buf[60];
00063   char format[16];
00064   // form the format for r
00065   sprintf (format, "%%%de %%%de", w, w);
00066   // form string as desired
00067   sprintf (buf, format, r.real(), r.imag());
00068   *this << buf;
00069   return *this;
00070 }

template<typename T >
OFStream & libMesh::OFStream::scientific ( const sizetype  w,
const T  r 
) [inline]
Returns:
a OFStream, where r was directed in scientific style with size w.

Definition at line 38 of file o_f_stream.C.

00040 {
00041   libmesh_assert_less (w, 30);
00042   char buf[30];
00043   char format[8];
00044   // form the format for r
00045   sprintf (format, "%%%de", w);
00046   // form string as desired
00047   sprintf (buf, format, r);
00048   *this << buf;
00049   return *this;
00050 }


The documentation for this class was generated from the following files:

Site Created By: libMesh Developers
Last modified: February 05 2013 19:55:32 UTC

Hosted By:
SourceForge.net Logo