FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

An Ostream is an abstract base class for all output systems (streams, files, token lists, etc). More...

#include <OpenFOAM/Ostream.H>


Detailed Description

An Ostream is an abstract base class for all output systems (streams, files, token lists, etc).

Source files

Definition at line 54 of file Ostream.H.

Inheritance diagram for Ostream:
Collaboration diagram for Ostream:

List of all members.

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.

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 79 of file Ostream.H.

virtual ~Ostream (  ) [inline, virtual]

Destructor.

Definition at line 91 of file Ostream.H.


Member Function Documentation

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.

Foam::Ostream & write ( const keyType &   kw  ) [virtual]

Write keyType.

Definition at line 52 of file Ostream.C.

References keyType::isPattern().

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

Write string.

Implemented in ensightFile, OPstream, OSstream, and prefixOSstream.

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

Write std::string surrounded by quotes.

Optional write without quotes.

Implemented in OPstream, OSstream, and prefixOSstream.

Referenced by Foam::operator<<().

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 ensightFile, OPstream, OSstream, and prefixOSstream.

virtual void indent (  ) [pure virtual]

Add indentation characters.

Implemented in OPstream, OSstream, and prefixOSstream.

Referenced by Foam::indent(), and dictionaryEntry::write().

unsigned short indentLevel (  ) const [inline]

Return indent level.

Definition at line 141 of file Ostream.H.

References Ostream::indentLevel_.

unsigned short& indentLevel (  ) [inline]

Access to indent level.

Definition at line 147 of file Ostream.H.

References Ostream::indentLevel_.

void incrIndent (  ) [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<<(), nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField::write(), kappatJayatillekeWallFunctionFvPatchScalarField::write(), incompressible::fixedShearStressFvPatchVectorField::write(), incompressible::atmBoundaryLayerInletVelocityFvPatchVectorField::write(), incompressible::atmBoundaryLayerInletEpsilonFvPatchScalarField::write(), mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField::write(), turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::write(), turbulentTemperatureCoupledBaffleFvPatchScalarField::write(), incompressible::turbulentMixingLengthFrequencyInletFvPatchScalarField::write(), turbulentMixingLengthFrequencyInletFvPatchScalarField::write(), incompressible::turbulentMixingLengthDissipationRateInletFvPatchScalarField::write(), turbulentMixingLengthDissipationRateInletFvPatchScalarField::write(), incompressible::turbulentHeatFluxTemperatureFvPatchScalarField::write(), turbulentHeatFluxTemperatureFvPatchScalarField::write(), alphaSgsJayatillekeWallFunctionFvPatchScalarField::write(), timeVaryingAlphaContactAngleFvPatchScalarField::write(), dynamicAlphaContactAngleFvPatchScalarField::write(), constantAlphaContactAngleFvPatchScalarField::write(), alphaContactAngleFvPatchScalarField::write(), interpolationLookUpTable< Type >::write(), wideBandDiffusiveRadiationMixedFvPatchScalarField::write(), MarshakRadiationFixedTMixedFvPatchScalarField::write(), MarshakRadiationFvPatchScalarField::write(), greyDiffusiveRadiationMixedFvPatchScalarField::write(), surfZoneIdentifier::write(), sixDoFRigidBodyMotionState::write(), tabulatedAxialAngularSpring::write(), sphericalAngularSpring::write(), linearSpring::write(), linearAxialAngularSpring::write(), sixDoFRigidBodyMotion::write(), sixDoFRigidBodyMotionConstraint::write(), fixedPoint::write(), fixedPlane::write(), fixedLine::write(), fixedAxis::write(), sixDoFRigidBodyDisplacementPointPatchVectorField::write(), polyPatch::write(), processorPolyPatch::write(), cyclicPolyPatch::write(), genericPolyPatch::write(), patchIdentifier::write(), tableReader< Type >::write(), csvTableReader< Type >::write(), interpolationTable< Type >::write(), pointPatchField< Type >::write(), uniformFixedValuePointPatchField< Type >::write(), fixedNormalSlipPointPatchField< Type >::write(), primitiveEntry::write(), directMappedPatchBase::write(), genericPointPatchField< Type >::write(), genericFvPatchField< Type >::write(), surfaceSlipDisplacementPointPatchVectorField::write(), surfaceDisplacementPointPatchVectorField::write(), oscillatingVelocityPointPatchVectorField::write(), oscillatingDisplacementPointPatchVectorField::write(), angularOscillatingVelocityPointPatchVectorField::write(), angularOscillatingDisplacementPointPatchVectorField::write(), fvsPatchField< Type >::write(), fvPatchField< Type >::write(), waveTransmissiveFvPatchField< Type >::write(), uniformFixedValueFvPatchField< Type >::write(), uniformDensityHydrostaticPressureFvPatchScalarField::write(), turbulentIntensityKineticEnergyInletFvPatchScalarField::write(), turbulentInletFvPatchField< Type >::write(), translatingWallVelocityFvPatchVectorField::write(), totalTemperatureFvPatchScalarField::write(), timeVaryingUniformTotalPressureFvPatchScalarField::write(), timeVaryingMappedPressureDirectedInletVelocityFvPatchVectorField::write(), timeVaryingMappedFixedValueFvPatchField< Type >::write(), syringePressureFvPatchScalarField::write(), swirlFlowRateInletVelocityFvPatchVectorField::write(), supersonicFreestreamFvPatchVectorField::write(), rotatingWallVelocityFvPatchVectorField::write(), rotatingTotalPressureFvPatchScalarField::write(), rotatingPressureInletOutletVelocityFvPatchVectorField::write(), pressureNormalInletOutletVelocityFvPatchVectorField::write(), pressureInletVelocityFvPatchVectorField::write(), pressureInletOutletVelocityFvPatchVectorField::write(), pressureDirectedInletVelocityFvPatchVectorField::write(), pressureDirectedInletOutletVelocityFvPatchVectorField::write(), outletMappedUniformInletFvPatchField< Type >::write(), oscillatingFixedValueFvPatchField< Type >::write(), inletOutletTotalTemperatureFvPatchScalarField::write(), inletOutletFvPatchField< Type >::write(), freestreamFvPatchField< Type >::write(), fluxCorrectedVelocityFvPatchVectorField::write(), flowRateInletVelocityFvPatchVectorField::write(), fixedPressureCompressibleDensityFvPatchScalarField::write(), fixedFluxPressureFvPatchScalarField::write(), fanFvPatchField< Type >::write(), directMappedVelocityFluxFixedValueFvPatchField::write(), directMappedFixedValueFvPatchField< Type >::write(), cylindricalInletVelocityFvPatchVectorField::write(), buoyantPressureFvPatchScalarField::write(), advectiveFvPatchField< Type >::write(), activeBaffleVelocityFvPatchVectorField::write(), SRFVelocityFvPatchVectorField::write(), SRFFreestreamVelocityFvPatchVectorField::write(), boundaryPatch::write(), UniformDimensionedField< Type >::writeData(), DimensionedField< Type, GeoMesh >::writeData(), TimeActivatedExplicitSource< Type >::writeData(), explicitSource::writeData(), basicSource::writeData(), actuationDiskSource::writeData(), ensightPart::writeData(), surfZone::writeDict(), plane::writeDict(), toroidalCS::writeDict(), coordinateSystem::writeDict(), porousZone::writeDict(), Field< Type >::writeEntry(), UList< T >::writeEntry(), FixedList< T, Size >::writeEntry(), fvPatchField< Type >::writeEntryIfDifferent(), nutWallFunctionFvPatchScalarField::writeLocalEntries(), mutWallFunctionFvPatchScalarField::writeLocalEntries(), mutkWallFunctionFvPatchScalarField::writeLocalEntries(), and ensightPart::writeSummary().

virtual void flush (  ) [pure virtual]
virtual void endl (  ) [pure virtual]

Add newline and flush stream.

Implemented in OPstream, and OSstream.

Referenced by Ostream::decrIndent(), and Foam::endl().

virtual int width (  ) const [pure virtual]

Get width of output field.

Implemented in OPstream, and OSstream.

Referenced by Foam::setw().

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::operator<<(), Foam::setprecision(), and STARCDsurfaceFormatCore::writePoints().

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 191 of file Ostream.H.


Member Data Documentation

const unsigned short indentSize_ = 4 [static, protected]

Number of spaces per indent level.

Definition at line 64 of file Ostream.H.

const unsigned short entryIndentation_ = 16 [static, protected]

Indentation of the entry from the start of the keyword.

Definition at line 67 of file Ostream.H.

unsigned short indentLevel_ [protected]

Current indent level.

Definition at line 70 of file Ostream.H.

Referenced by Ostream::decrIndent(), Ostream::incrIndent(), and Ostream::indentLevel().


The documentation for this class was generated from the following files:
  • src/OpenFOAM/db/IOstreams/IOstreams/Ostream.H
  • src/OpenFOAM/db/IOstreams/IOstreams/Ostream.C