OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

OSstream Class Reference

Generic output stream. More...

Inheritance diagram for OSstream:
Collaboration diagram for OSstream:

List of all members.


Public Member Functions

 OSstream (ostream &os, const string &name, streamFormat format=ASCII, versionNumber version=currentVersion, compressionType compression=UNCOMPRESSED)
 Set stream status.
virtual const fileNamename () const
 Return the name of the stream.
virtual fileNamename ()
 Return non-const access to the name of the stream.
virtual ios_base::fmtflags flags () const
 Return flags of output stream.
virtual Ostreamwrite (const token &)
 Write next token to stream.
virtual Ostreamwrite (const char)
 Write character.
virtual Ostreamwrite (const char *)
 Write character string.
virtual Ostreamwrite (const word &)
 Write word.
virtual Ostreamwrite (const string &)
 Write string.
virtual OstreamwriteQuoted (const std::string &, const bool quoted=true)
 Write std::string surrounded by quotes.
virtual Ostreamwrite (const label)
 Write label.
virtual Ostreamwrite (const floatScalar)
 Write floatScalar.
virtual Ostreamwrite (const doubleScalar)
 Write doubleScalar.
virtual Ostreamwrite (const char *, std::streamsize)
 Write binary block.
virtual void indent ()
 Add indentation characters.
virtual ios_base::fmtflags flags (const ios_base::fmtflags flags)
 Set flags of output stream.
virtual void flush ()
 Flush stream.
virtual void endl ()
 Add newline and flush stream.
virtual int width () const
 Get width of output field.
virtual int width (const int)
 Set width of output field (and return old width).
virtual int precision () const
 Get precision of output field.
virtual int precision (const int)
 Set precision of output field (and return old precision).
virtual void print (Ostream &) const
 Print description of IOstream to Ostream.

Protected Member Functions

ostream & stream ()
 Return the stream reference.
const ostream & stream () const
 Return the const stream reference.

Detailed Description

Generic output stream.

Source files

Definition at line 48 of file OSstream.H.


Constructor & Destructor Documentation

OSstream ( ostream &  os,
const string name,
streamFormat  format = ASCII,
versionNumber  version = currentVersion,
compressionType  compression = UNCOMPRESSED 
) [inline]

Set stream status.

Definition at line 23 of file OSstreamI.H.

References IOstream::precision_, IOstream::setGood(), IOstream::setOpened(), and IOstream::setState().

Here is the call graph for this function:


Member Function Documentation

ostream& stream (  )  [inline, protected]

Return the stream reference.

Definition at line 67 of file OSstream.H.

Referenced by OSHA1stream::digest(), ensightFile::newline(), OStringStream::str(), ensightFile::write(), and ensightFile::writeUndef().

Here is the caller graph for this function:

const ostream& stream (  )  const [inline, protected]

Return the const stream reference.

Definition at line 73 of file OSstream.H.

virtual const fileName& name (  )  const [inline, virtual]

Return the name of the stream.

Useful for Fstream to return the filename

Reimplemented from IOstream.

Reimplemented in OFstream.

Definition at line 102 of file OSstream.H.

Referenced by cyclicPolyPatch::order(), and fvMeshDistribute::printFieldInfo().

Here is the caller graph for this function:

virtual fileName& name (  )  [inline, virtual]

Return non-const access to the name of the stream.

Useful to alter the stream name

Reimplemented from IOstream.

Reimplemented in OFstream.

Definition at line 111 of file OSstream.H.

std::ios_base::fmtflags flags (  )  const [virtual]

Return flags of output stream.

Implements IOstream.

Definition at line 233 of file OSstream.C.

References OSstream::write().

Here is the call graph for this function:

Foam::Ostream & write ( const token  )  [virtual]

Write next token to stream.

Implements Ostream.

Reimplemented in prefixOSstream.

Definition at line 24 of file OSstream.C.

Referenced by OSstream::flags().

Here is the caller graph for this function:

Foam::Ostream & write ( const char  c  )  [virtual]

Write character.

Implements Ostream.

Reimplemented in prefixOSstream.

Definition at line 30 of file OSstream.C.

Foam::Ostream & write ( const char *  str  )  [virtual]

Write character string.

Implements Ostream.

Reimplemented in prefixOSstream.

Definition at line 42 of file OSstream.C.

References IOstream::lineNumber_.

Foam::Ostream & write ( const word str  )  [virtual]

Write word.

Implements Ostream.

Reimplemented in prefixOSstream.

Definition at line 51 of file OSstream.C.

References IOstream::lineNumber_, token::NL, and IOstream::setState().

Here is the call graph for this function:

Foam::Ostream & write ( const string str  )  [virtual]

Write string.

In the rare case that the string contains a final trailing backslash, it will be dropped to the appearance of an escaped double-quote.

Implements Ostream.

Reimplemented in ensightFile, and prefixOSstream.

Definition at line 59 of file OSstream.C.

References IOstream::setState().

Here is the call graph for this function:

Foam::Ostream & writeQuoted ( const std::string &  str,
const bool  quoted = true 
) [virtual]

Write std::string surrounded by quotes.

Optional write without quotes.

Implements Ostream.

Reimplemented in prefixOSstream.

Definition at line 105 of file OSstream.C.

Foam::Ostream & write ( const label  val  )  [virtual]

Write label.

Implements Ostream.

Reimplemented in prefixOSstream.

Definition at line 166 of file OSstream.C.

Foam::Ostream & write ( const floatScalar  val  )  [virtual]

Write floatScalar.

Implements Ostream.

Reimplemented in prefixOSstream.

Definition at line 174 of file OSstream.C.

References IOstream::setState().

Here is the call graph for this function:

Foam::Ostream & write ( const doubleScalar  val  )  [virtual]

Write doubleScalar.

Implements Ostream.

Reimplemented in prefixOSstream.

Definition at line 182 of file OSstream.C.

References IOstream::setState().

Here is the call graph for this function:

Foam::Ostream & write ( const char *  buf,
std::streamsize  count 
) [virtual]

Write binary block.

Implements Ostream.

Reimplemented in ensightFile, and prefixOSstream.

Definition at line 190 of file OSstream.C.

References IOstream::setState().

Here is the call graph for this function:

void indent (  )  [virtual]

Add indentation characters.

Implements Ostream.

Reimplemented in prefixOSstream.

Definition at line 209 of file OSstream.C.

std::ios_base::fmtflags flags ( const ios_base::fmtflags  flags  )  [virtual]

Set flags of output stream.

Definition at line 240 of file OSstream.C.

void flush (  )  [virtual]

Flush stream.

Implements Ostream.

Definition at line 218 of file OSstream.C.

References Ostream::indentLevel_, and Ostream::indentSize_.

void endl (  )  [virtual]

Add newline and flush stream.

Implements Ostream.

Definition at line 225 of file OSstream.C.

int width (  )  const [virtual]

Get width of output field.

Implements Ostream.

Definition at line 250 of file OSstream.C.

int width ( const int  w  )  [virtual]

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

Implements Ostream.

Definition at line 256 of file OSstream.C.

int precision (  )  const [virtual]

Get precision of output field.

Implements Ostream.

Definition at line 262 of file OSstream.C.

Referenced by Time::readDict().

Here is the caller graph for this function:

int precision ( const int  p  )  [virtual]

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

Implements Ostream.

Definition at line 268 of file OSstream.C.

void print ( Ostream os  )  const [virtual]

Print description of IOstream to Ostream.

Reimplemented from IOstream.

Reimplemented in OFstream, prefixOSstream, and OStringStream.

Definition at line 36 of file SstreamsPrint.C.

References ISstream::name(), and ISstream::print().

Here is the call graph for this function:


The documentation for this class was generated from the following files:
Copyright © 2000-2009 OpenCFD Ltd