OpenFOAM logo
The Open Source CFD Toolbox
  Programmer’s C++ Doxygen OpenCFD Solutions Contact OpenFOAM

Ostream Class Reference

Inheritance diagram for Ostream:

Inheritance graph
[legend]
Collaboration diagram for Ostream:

Collaboration graph
[legend]
List of all members.

Detailed Description

Definition at line 60 of file Ostream.H.


Public Member Functions

 Ostream (streamFormat format=ASCII, versionNumber version=currentVersion, compressionType compression=UNCOMPRESSED)
 Set stream status.
virtual ~Ostream ()
virtual Ostream & write (const token &)=0
 Write next token to stream.
virtual Ostream & write (const char)=0
 Write character.
virtual Ostream & write (const char *)=0
 Write character string.
virtual Ostream & write (const word &)=0
 Write word.
virtual Ostream & write (const string &)=0
 Write string.
virtual Ostream & write (const label)=0
 Write label.
virtual Ostream & write (const floatScalar)=0
 Write floatScalar.
virtual Ostream & write (const doubleScalar)=0
 Write doubleScalar.
virtual Ostream & write (const char *, std::streamsize)=0
 Write binary block.
virtual void indent ()=0
 Add indentation characters.
unsigned short indentLevel () const
 Return indent level.
unsigned short & indentLevel ()
 Access to indent level.
void incrIndent ()
 Incrememt the indent level.
void decrIndent ()
 Decrememt the indent level.
Ostream & writeKeyword (const word &keyword)
 Write the keyword to the Ostream followed by.
virtual void flush ()=0
 Flush stream.
virtual void endl ()=0
 Add '
' and flush stream.
virtual int width () const=0
 Get width of output field.
virtual int width (const int w)=0
 Set width of output field (and return old width).
virtual int precision () const=0
 Get precision of output field.
virtual int precision (const int p)=0
 Set precision of output field (and return old precision).
Ostream & operator() () const
 Return a non-const reference to const Ostream.

Protected Attributes

unsigned short indentLevel_
 Current indent level.

Static Protected Attributes

static const unsigned short indentSize_ = 4
 Number of spaces per indent level.
static const unsigned short entryIndentation_ = 16
 Indentation of the entry from the start of the keyword.

Constructor & Destructor Documentation

Ostream ( streamFormat  format = ASCII,
versionNumber  version = currentVersion,
compressionType  compression = UNCOMPRESSED 
) [inline]

Set stream status.

Definition at line 85 of file Ostream.H.

virtual ~Ostream (  )  [inline, virtual]

Definition at line 98 of file Ostream.H.

References Ostream::indentLevel_.


Member Function Documentation

virtual Ostream& write ( const token &   )  [pure virtual]

Write next token to stream.

Implemented in OPstream, OSstream, and prefixOSstream.

virtual Ostream& write ( const   char  )  [pure virtual]

Write character.

Implemented in OPstream, OSstream, and prefixOSstream.

virtual Ostream& write ( const char *   )  [pure virtual]

Write character string.

Implemented in OPstream, OSstream, and prefixOSstream.

virtual Ostream& write ( const word &   )  [pure virtual]

Write word.

Implemented in OPstream, OSstream, and prefixOSstream.

virtual Ostream& write ( const string &   )  [pure virtual]

Write string.

Implemented in OPstream, OSstream, and prefixOSstream.

virtual Ostream& write ( const   label  )  [pure virtual]

Write label.

Implemented in OPstream, OSstream, and prefixOSstream.

virtual Ostream& write ( const   floatScalar  )  [pure virtual]

Write floatScalar.

Implemented in OPstream, OSstream, and prefixOSstream.

virtual Ostream& write ( const   doubleScalar  )  [pure virtual]

Write doubleScalar.

Implemented in OPstream, OSstream, and prefixOSstream.

virtual Ostream& write ( const char *  ,
std::streamsize   
) [pure virtual]

Write binary block.

Implemented in OPstream, OSstream, and prefixOSstream.

virtual void indent (  )  [pure virtual]

Add indentation characters.

Implemented in OPstream, OSstream, and prefixOSstream.

unsigned short indentLevel (  )  const [inline]

Return indent level.

Definition at line 137 of file Ostream.H.

References Ostream::indentLevel_.

unsigned short& indentLevel (  )  [inline]

Access to indent level.

Definition at line 143 of file Ostream.H.

References Ostream::indentLevel_.

void incrIndent (  )  [inline]

Incrememt the indent level.

Definition at line 149 of file Ostream.H.

void decrIndent (  ) 

Decrememt the indent level.

Ostream& writeKeyword ( const word &  keyword  ) 

Write the keyword to the Ostream followed by.

appropriate indentation

virtual void flush (  )  [pure virtual]

Flush stream.

Implemented in OPstream, and OSstream.

virtual void endl (  )  [pure virtual]

Add '
' and flush stream.

Implemented in OPstream, and OSstream.

virtual int width (  )  const [pure virtual]

Get width of output field.

Implemented in OPstream, and OSstream.

virtual int width ( const int  w  )  [pure virtual]

Set width of output field (and return old width).

Implemented in OPstream, and OSstream.

virtual int precision (  )  const [pure virtual]

Get precision of output field.

Implemented in OPstream, and OSstream.

Referenced by Foam::setw().

Here is the caller graph for this function:

virtual int precision ( const int  p  )  [pure virtual]

Set precision of output field (and return old precision).

Implemented in OPstream, and OSstream.

Ostream& operator() (  )  const [inline]

Return a non-const reference to const Ostream.

Needed for write functions where the stream argument is temporary: e.g. thing thisThing(OFstream("thingFileName")());

Definition at line 192 of file Ostream.H.


Member Data Documentation

const unsigned short indentSize_ = 4 [static, protected]

Number of spaces per indent level.

Definition at line 70 of file Ostream.H.

unsigned short indentLevel_ [protected]

Current indent level.

Definition at line 73 of file Ostream.H.

Referenced by Ostream::indentLevel(), and Ostream::~Ostream().

const unsigned short entryIndentation_ = 16 [static, protected]

Indentation of the entry from the start of the keyword.

Definition at line 76 of file Ostream.H.


The documentation for this class was generated from the following file:
  • src/OpenFOAM/db/IOstreams/IOstreams/Ostream.H
Copyright © 2000-2007 OpenCFD Ltd