Generic output stream. More...
#include <OpenFOAM/OSstream.H>
Generic output stream.
Definition at line 53 of file OSstream.H.
Public Member Functions | |
OSstream (ostream &os, const string &name, streamFormat format=ASCII, versionNumber version=currentVersion, compressionType compression=UNCOMPRESSED) | |
Set stream status.
| |
virtual const fileName & | name () const |
Return the name of the stream.
| |
virtual fileName & | name () |
Return non-const access to the name of the stream.
| |
virtual ios_base::fmtflags | flags () const |
Return flags of output stream.
| |
virtual Ostream & | write (const token &) |
Write next token to stream.
| |
virtual Ostream & | write (const char) |
Write character.
| |
virtual Ostream & | write (const char *) |
Write character string.
| |
virtual Ostream & | write (const word &) |
Write word.
| |
virtual Ostream & | write (const string &) |
Write string.
| |
virtual Ostream & | writeQuoted (const std::string &, const bool quoted=true) |
Write std::string surrounded by quotes.
| |
virtual Ostream & | write (const label) |
Write label.
| |
virtual Ostream & | write (const floatScalar) |
Write floatScalar.
| |
virtual Ostream & | write (const doubleScalar) |
Write doubleScalar.
| |
virtual Ostream & | write (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.
|
OSstream | ( | ostream & | os, |
const string & | name, | ||
streamFormat | format = ASCII ,
|
||
versionNumber | version = currentVersion ,
|
||
compressionType | compression = UNCOMPRESSED
|
||
) | [inline]
|
Set stream status.
Definition at line 31 of file OSstreamI.H.
ostream& stream | ( | ) | [inline, protected]
|
Return the stream reference.
Definition at line 72 of file OSstream.H.
Referenced by OStringStream::rewind(), OSHA1stream::sha1(), OStringStream::str(), OSHA1stream::~OSHA1stream(), and OStringStream::~OStringStream().
const ostream& stream | ( | ) | const [inline, protected]
|
Return the const stream reference.
Definition at line 78 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 105 of file OSstream.H.
Referenced by fvMotionSolver::cellMotionBoundaryTypes(), probes::checkFieldTypes(), timeVaryingMappedFixedValueFvPatchField< Type >::checkTable(), fvMeshAdder::MapSurfaceFields(), processorPolyPatch::order(), cyclicPolyPatch::order(), fvMeshDistribute::printFieldInfo(), boundaryMesh::readTriSurface(), motionSmoother::setDisplacement(), removeFaces::setRefinement(), hexRef8::setRefinement(), triSurface::triSurfInstance(), timeVaryingMappedFixedValueFvPatchField< Type >::updateCoeffs(), and partialWrite::write().
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 112 of file OSstream.H.
std::ios_base::fmtflags flags | ( | ) | const [virtual]
|
Foam::Ostream & write | ( | const token & | ) | [virtual]
|
Write next token to stream.
Implements Ostream.
Reimplemented in prefixOSstream.
Definition at line 32 of file OSstream.C.
Referenced by prefixOSstream::write().
Foam::Ostream & write | ( | const char | c ) | [virtual]
|
Write character.
Implements Ostream.
Reimplemented in prefixOSstream.
Definition at line 38 of file OSstream.C.
References token::NL.
Foam::Ostream & write | ( | const char * | str ) | [virtual]
|
Write character string.
Implements Ostream.
Reimplemented in prefixOSstream.
Definition at line 50 of file OSstream.C.
References string::count(), and token::NL.
Foam::Ostream & write | ( | const word & | str ) | [virtual]
|
Write word.
Implements Ostream.
Reimplemented in prefixOSstream.
Definition at line 59 of file OSstream.C.
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 67 of file OSstream.C.
References token::BEGIN_STRING, token::END_STRING, and token::NL.
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 113 of file OSstream.C.
References token::BEGIN_STRING, string::count(), token::END_STRING, and token::NL.
Referenced by prefixOSstream::writeQuoted().
Foam::Ostream & write | ( | const label | val ) | [virtual]
|
Write label.
Implements Ostream.
Reimplemented in prefixOSstream.
Definition at line 174 of file OSstream.C.
Foam::Ostream & write | ( | const floatScalar | val ) | [virtual]
|
Write floatScalar.
Implements Ostream.
Reimplemented in prefixOSstream.
Definition at line 182 of file OSstream.C.
Foam::Ostream & write | ( | const doubleScalar | val ) | [virtual]
|
Write doubleScalar.
Implements Ostream.
Reimplemented in prefixOSstream.
Definition at line 190 of file OSstream.C.
Foam::Ostream & write | ( | const char * | buf, |
std::streamsize | count | ||
) | [virtual]
|
Write binary block.
Implements Ostream.
Reimplemented in ensightFile, and prefixOSstream.
Definition at line 198 of file OSstream.C.
References Foam::abort(), token::BEGIN_LIST, token::END_LIST, Foam::FatalIOError, FatalIOErrorIn, and format().
void indent | ( | ) | [virtual]
|
Add indentation characters.
Implements Ostream.
Reimplemented in prefixOSstream.
Definition at line 217 of file OSstream.C.
Referenced by prefixOSstream::indent().
std::ios_base::fmtflags flags | ( | const ios_base::fmtflags | flags ) | [virtual]
|
Set flags of output stream.
Definition at line 248 of file OSstream.C.
void flush | ( | ) | [virtual]
|
Flush stream.
Implements Ostream.
Definition at line 226 of file OSstream.C.
References Ostream::flush().
Referenced by DsmcCloud< ParcelType >::dumpParticlePositions(), and Cloud< ParticleType >::writePositions().
void endl | ( | ) | [virtual]
|
int width | ( | ) | const [virtual]
|
int width | ( | const int | w ) | [virtual]
|
Set width of output field (and return old width)
Implements Ostream.
Definition at line 264 of file OSstream.C.
int precision | ( | ) | const [virtual]
|
Get precision of output field.
Implements Ostream.
Definition at line 270 of file OSstream.C.
Referenced by Time::readDict(), and STARCD::writeSurface().
int precision | ( | const int | p ) | [virtual]
|
Set precision of output field (and return old precision)
Implements Ostream.
Definition at line 276 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 43 of file SstreamsPrint.C.
References Foam::name(), and IOstream::print().
Referenced by OStringStream::print(), prefixOSstream::print(), and OFstream::print().