An Ostream is an abstract base class for all output systems (streams, files, token lists, etc). More...
#include <OpenFOAM/Ostream.H>
An Ostream is an abstract base class for all output systems (streams, files, token lists, etc).
Public Member Functions | |
Ostream (streamFormat format=ASCII, versionNumber version=currentVersion, compressionType compression=UNCOMPRESSED) | |
Set stream status. | |
virtual | ~Ostream () |
Destructor. | |
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 keyType &) |
Write keyType. | |
virtual Ostream & | write (const string &)=0 |
Write string. | |
virtual Ostream & | writeQuoted (const std::string &, const bool quoted=true)=0 |
Write std::string surrounded by quotes. | |
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 keyType &) |
Write the keyword followed by an appropriate indentation. | |
virtual void | flush ()=0 |
Flush stream. | |
virtual void | endl ()=0 |
Add newline 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. | |
![]() | |
IOstream (streamFormat format, versionNumber version, compressionType compression=UNCOMPRESSED) | |
Construct setting format and version. | |
virtual | ~IOstream () |
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 bool | check (const char *operation) const |
Check IOstream status for given operation. | |
void | fatalCheck (const char *operation) const |
Check IOstream status for given operation. | |
bool | opened () const |
Return true if stream has been opened. | |
bool | closed () const |
Return true if stream is closed. | |
bool | good () const |
Return true if next operation might succeed. | |
bool | eof () const |
Return true if end of input seen. | |
bool | fail () const |
Return true if next operation will fail. | |
bool | bad () const |
Return true if stream is corrupted. | |
operator void * () const | |
Return non-zero if the stream has not failed. | |
bool | operator! () const |
Return true if the stream has failed. | |
streamFormat | format () const |
Return current stream format. | |
streamFormat | format (const streamFormat fmt) |
Set the stream format. | |
streamFormat | format (const word &fmt) |
Set the stream format from word. | |
versionNumber | version () const |
Return the stream version. | |
versionNumber | version (const versionNumber ver) |
Set the stream version. | |
compressionType | compression () const |
Return the stream compression. | |
compressionType | compression (const compressionType cmp) |
Set the stream compression. | |
compressionType | compression (const word &cmp) |
Set the stream compression from word. | |
label | lineNumber () const |
Return current stream line number. | |
label & | lineNumber () |
Return current stream line number. | |
label | lineNumber (const label ln) |
Set the stream line number. | |
virtual ios::fmtflags | flags () const =0 |
Return flags of stream. | |
void | setEof () |
Set stream to have reached eof. | |
void | setFail () |
Set stream to have failed. | |
void | setBad () |
Set stream to be bad. | |
virtual ios::fmtflags | flags (const ios::fmtflags f)=0 |
Set flags of stream. | |
ios::fmtflags | setf (const ios::fmtflags f) |
Set flags of stream. | |
ios::fmtflags | setf (const ios::fmtflags f, const ios::fmtflags mask) |
Set flags of given field of stream. | |
void | unsetf (const ios::fmtflags uf) |
Unset flags of stream. | |
virtual void | print (Ostream &) const |
Print description of IOstream to Ostream. | |
void | print (Ostream &, const int streamState) const |
Check given stream state bits. | |
InfoProxy< IOstream > | info () const |
Return info proxy. |
Protected Attributes | |
unsigned short | indentLevel_ |
Current indent level. | |
![]() | |
label | lineNumber_ |
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. |
Additional Inherited Members | |
![]() | |
enum | streamAccess { OPENED, CLOSED } |
Enumeration for whether the stream open or closed. More... | |
enum | streamFormat { ASCII, BINARY } |
Enumeration for the format of data in the stream. More... | |
enum | compressionType { UNCOMPRESSED, COMPRESSED } |
Enumeration for the format of data in the stream. More... | |
![]() | |
static streamFormat | formatEnum (const word &) |
Return stream format of given format name. | |
static compressionType | compressionEnum (const word &) |
Return compression of given compression name. | |
static unsigned int | defaultPrecision () |
Return the default precision. | |
static unsigned int | defaultPrecision (unsigned int p) |
Reset the default precision (and return old precision) | |
![]() | |
static const versionNumber | originalVersion |
Original version number. | |
static const versionNumber | currentVersion |
Current version number. | |
static unsigned int | precision_ |
Default precision. | |
![]() | |
void | setOpened () |
Set stream opened. | |
void | setClosed () |
Set stream closed. | |
void | setState (ios::iostate state) |
Set stream state. | |
void | setGood () |
Set stream to be good. |
|
inline |
Write next token to stream.
Implemented in OPstream, OSstream, and prefixOSstream.
Referenced by autoHexMeshDriver::autoHexMeshDriver(), hexRef8::consistentSlowRefinement2(), if(), Foam::operator<<(), errorDrivenRefinement::setRefinement(), refinementIterator::setRefinement(), hexRef8::setRefinement(), ensightFile::write(), dsmcFields::write(), dictionaryEntry::write(), Particle< ParticleType >::write(), actuationDiskSource::writeData(), porousZone::writeDict(), interpolate::writeInterpolateField(), and randomise::writeRandomField().
|
pure virtual |
Write character.
Implemented in OPstream, OSstream, and prefixOSstream.
|
pure virtual |
Write character string.
Implemented in OPstream, OSstream, and prefixOSstream.
Write word.
Implemented in OPstream, OSstream, and prefixOSstream.
|
virtual |
Write string.
Implemented in OPstream, OSstream, ensightFile, and prefixOSstream.
|
pure virtual |
Write std::string surrounded by quotes.
Optional write without quotes.
Implemented in OPstream, OSstream, and prefixOSstream.
Referenced by Foam::operator<<().
|
pure virtual |
Write label.
Implemented in OPstream, OSstream, and prefixOSstream.
|
pure virtual |
Write floatScalar.
Implemented in OPstream, OSstream, and prefixOSstream.
|
pure virtual |
Write doubleScalar.
Implemented in OPstream, OSstream, and prefixOSstream.
|
pure virtual |
Write binary block.
Implemented in OPstream, OSstream, prefixOSstream, and ensightFile.
|
pure virtual |
Add indentation characters.
Implemented in OPstream, OSstream, and prefixOSstream.
Referenced by Foam::indent(), and dictionaryEntry::write().
|
inline |
|
inline |
|
inline |
Incrememt the indent level.
Definition at line 153 of file Ostream.H.
References Ostream::indentLevel_.
Referenced by Foam::incrIndent().
void decrIndent | ( | ) |
Decrememt the indent level.
Definition at line 35 of file Ostream.C.
References Ostream::endl(), and Ostream::indentLevel_.
Referenced by Foam::decrIndent().
Foam::Ostream & writeKeyword | ( | const keyType & | kw | ) |
Write the keyword followed by an appropriate indentation.
Definition at line 59 of file Ostream.C.
References Foam::indent(), keyType::isPattern(), and token::SPACE.
Referenced by Foam::operator<<(), csvTableReader< Type >::write(), tableReader< Type >::write(), fixedPlane::write(), fixedAxis::write(), fixedPoint::write(), sphericalAngularSpring::write(), fixedLine::write(), linearAxialAngularSpring::write(), boundaryPatch::write(), linearSpring::write(), tabulatedAxialAngularSpring::write(), inletOutletFvPatchField< Type >::write(), timeVaryingAlphaContactAngleFvPatchScalarField::write(), incompressible::fixedShearStressFvPatchVectorField::write(), oscillatingDisplacementPointPatchVectorField::write(), fluxCorrectedVelocityFvPatchVectorField::write(), buoyantPressureFvPatchScalarField::write(), freestreamFvPatchField< Type >::write(), genericPolyPatch::write(), constantAlphaContactAngleFvPatchScalarField::write(), directMappedVelocityFluxFixedValueFvPatchField::write(), translatingWallVelocityFvPatchVectorField::write(), patchIdentifier::write(), fixedFluxPressureFvPatchScalarField::write(), surfZoneIdentifier::write(), directMappedFixedValueFvPatchField< Type >::write(), dynamicAlphaContactAngleFvPatchScalarField::write(), fixedPressureCompressibleDensityFvPatchScalarField::write(), rotatingTotalPressureFvPatchScalarField::write(), outletMappedUniformInletFvPatchField< Type >::write(), fixedNormalSlipPointPatchField< Type >::write(), uniformFixedValuePointPatchField< Type >::write(), SRFFreestreamVelocityFvPatchVectorField::write(), oscillatingVelocityPointPatchVectorField::write(), genericPointPatchField< Type >::write(), uniformFixedValueFvPatchField< Type >::write(), waveTransmissiveFvPatchField< Type >::write(), alphaContactAngleFvPatchScalarField::write(), angularOscillatingDisplacementPointPatchVectorField::write(), angularOscillatingVelocityPointPatchVectorField::write(), interpolationTable< Type >::write(), turbulentIntensityKineticEnergyInletFvPatchScalarField::write(), turbulentMixingLengthDissipationRateInletFvPatchScalarField::write(), incompressible::turbulentMixingLengthDissipationRateInletFvPatchScalarField::write(), incompressible::turbulentMixingLengthFrequencyInletFvPatchScalarField::write(), turbulentMixingLengthFrequencyInletFvPatchScalarField::write(), rotatingPressureInletOutletVelocityFvPatchVectorField::write(), cylindricalInletVelocityFvPatchVectorField::write(), fanFvPatchField< Type >::write(), pressureInletVelocityFvPatchVectorField::write(), SRFVelocityFvPatchVectorField::write(), incompressible::turbulentHeatFluxTemperatureFvPatchScalarField::write(), sixDoFRigidBodyMotionConstraint::write(), sixDoFRigidBodyMotionState::write(), primitiveEntry::write(), greyDiffusiveRadiationMixedFvPatchScalarField::write(), wideBandDiffusiveRadiationMixedFvPatchScalarField::write(), turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::write(), turbulentTemperatureCoupledBaffleFvPatchScalarField::write(), swirlFlowRateInletVelocityFvPatchVectorField::write(), interpolationLookUpTable< Type >::write(), pressureNormalInletOutletVelocityFvPatchVectorField::write(), flowRateInletVelocityFvPatchVectorField::write(), incompressible::atmBoundaryLayerInletEpsilonFvPatchScalarField::write(), genericFvPatchField< Type >::write(), rotatingWallVelocityFvPatchVectorField::write(), totalTemperatureFvPatchScalarField::write(), inletOutletTotalTemperatureFvPatchScalarField::write(), pressureInletOutletVelocityFvPatchVectorField::write(), kappatJayatillekeWallFunctionFvPatchScalarField::write(), activeBaffleVelocityFvPatchVectorField::write(), sixDoFRigidBodyDisplacementPointPatchVectorField::write(), turbulentHeatFluxTemperatureFvPatchScalarField::write(), alphaSgsJayatillekeWallFunctionFvPatchScalarField::write(), MarshakRadiationFvPatchScalarField::write(), pressureDirectedInletVelocityFvPatchVectorField::write(), MarshakRadiationFixedTMixedFvPatchScalarField::write(), timeVaryingMappedPressureDirectedInletVelocityFvPatchVectorField::write(), pressureDirectedInletOutletVelocityFvPatchVectorField::write(), uniformDensityHydrostaticPressureFvPatchScalarField::write(), turbulentInletFvPatchField< Type >::write(), supersonicFreestreamFvPatchVectorField::write(), syringePressureFvPatchScalarField::write(), surfaceSlipDisplacementPointPatchVectorField::write(), incompressible::atmBoundaryLayerInletVelocityFvPatchVectorField::write(), oscillatingFixedValueFvPatchField< Type >::write(), advectiveFvPatchField< Type >::write(), mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField::write(), timeVaryingUniformTotalPressureFvPatchScalarField::write(), surfaceDisplacementPointPatchVectorField::write(), nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField::write(), directMappedPatchBase::write(), timeVaryingMappedFixedValueFvPatchField< Type >::write(), processorPolyPatch::write(), polyPatch::write(), fvsPatchField< Type >::write(), pointPatchField< Type >::write(), cyclicPolyPatch::write(), sixDoFRigidBodyMotion::write(), fvPatchField< Type >::write(), UniformDimensionedField< Type >::writeData(), actuationDiskSource::writeData(), explicitSource::writeData(), DimensionedField< Type, GeoMesh >::writeData(), ensightPart::writeData(), TimeActivatedExplicitSource< Type >::writeData(), basicSource::writeData(), toroidalCS::writeDict(), surfZone::writeDict(), plane::writeDict(), porousZone::writeDict(), coordinateSystem::writeDict(), UList< T >::writeEntry(), FixedList< T, Size >::writeEntry(), Field< Type >::writeEntry(), fvPatchField< Type >::writeEntryIfDifferent(), mutkWallFunctionFvPatchScalarField::writeLocalEntries(), nutWallFunctionFvPatchScalarField::writeLocalEntries(), mutWallFunctionFvPatchScalarField::writeLocalEntries(), and ensightPart::writeSummary().
|
pure virtual |
Flush stream.
Implemented in OPstream, and OSstream.
Referenced by OSstream::flush(), Foam::flush(), wordRe::info(), STARCDsurfaceFormatCore::writeCase(), and STARCDsurfaceFormatCore::writePoints().
|
pure virtual |
Add newline and flush stream.
Implemented in OPstream, and OSstream.
Referenced by Ostream::decrIndent(), and Foam::endl().
|
pure virtual |
|
pure virtual |
|
pure virtual |
Get precision of output field.
Implemented in OPstream, and OSstream.
Referenced by Foam::operator<<(), Foam::setprecision(), and STARCDsurfaceFormatCore::writePoints().
|
pure virtual |
|
inline |
|
staticprotected |
|
staticprotected |
|
protected |
Current indent level.
Definition at line 70 of file Ostream.H.
Referenced by Ostream::decrIndent(), Ostream::incrIndent(), and Ostream::indentLevel().