IOstream Class Referenceabstract

An IOstream is an abstract base class for all input/output systems; be they streams, files, token lists etc. More...

Inheritance diagram for IOstream:
[legend]
Collaboration diagram for IOstream:
[legend]

Public Types

enum  streamAccess : char { CLOSED = 0 , OPENED }
 Enumeration for stream open/closed state. More...
 
- Public Types inherited from IOstreamOption
enum  streamFormat : char { ASCII = 0 , BINARY }
 Data format (ascii | binary) More...
 
enum  compressionType : char { UNCOMPRESSED = 0 , COMPRESSED }
 Compression treatment (UNCOMPRESSED | COMPRESSED) More...
 

Public Member Functions

 IOstream (const IOstream &)=default
 Copy construct. More...
 
virtual ~IOstream ()=default
 Destructor. More...
 
 IOstream (IOstreamOption streamOpt=IOstreamOption())
 
 IOstream (IOstreamOption::streamFormat fmt, IOstreamOption::versionNumber ver, IOstreamOption::compressionType cmp=IOstreamOption::UNCOMPRESSED)
 Construct with format, version (compression) More...
 
virtual const fileNamename () const
 Return the name of the stream. More...
 
virtual fileNamename ()
 Return stream name for modification. More...
 
fileName relativeName () const
 Return the name of the stream relative to the current case. More...
 
virtual bool check (const char *operation) const
 Check IOstream status for given operation. More...
 
bool fatalCheck (const char *operation) const
 Check IOstream status for given operation. More...
 
bool opened () const noexcept
 True if stream has been opened. More...
 
bool closed () const noexcept
 True if stream is closed. More...
 
bool good () const noexcept
 True if next operation might succeed. More...
 
bool eof () const noexcept
 True if end of input seen. More...
 
bool fail () const noexcept
 True if next operation will fail. More...
 
bool bad () const noexcept
 True if stream is corrupted. More...
 
 operator bool () const noexcept
 Return true if the stream has not failed. More...
 
bool operator! () const noexcept
 Return true if the stream has failed. More...
 
unsigned labelByteSize () const noexcept
 The sizeof (label) in bytes associated with the stream. More...
 
unsigned scalarByteSize () const noexcept
 The sizeof (scalar) in bytes associated with the stream. More...
 
void setLabelByteSize (unsigned nbytes) noexcept
 Set the sizeof (label) in bytes associated with the stream. More...
 
void setScalarByteSize (unsigned nbytes) noexcept
 Set the sizeof (scalar) in bytes associated with the stream. More...
 
template<class T = label>
std::enable_if< std::is_integral< T >::value, bool >::type checkLabelSize () const noexcept
 
template<class T = scalar>
std::enable_if< std::is_floating_point< T >::value, bool >::type checkScalarSize () const noexcept
 
label lineNumber () const noexcept
 Const access to the current stream line number. More...
 
label & lineNumber () noexcept
 Non-const access to the current stream line number. More...
 
label lineNumber (const label num) noexcept
 Set the stream line number. More...
 
virtual ios_base::fmtflags flags () const =0
 Return flags of stream. More...
 
void setEof () noexcept
 Set stream state as reached 'eof'. More...
 
void setFail () noexcept
 Set stream state as 'failed'. More...
 
void setBad ()
 Set stream state to be 'bad'. More...
 
virtual ios_base::fmtflags flags (const ios_base::fmtflags f)=0
 Set flags of stream. More...
 
ios_base::fmtflags setf (const ios_base::fmtflags f)
 Set flags of stream. More...
 
ios_base::fmtflags setf (const ios_base::fmtflags f, const ios_base::fmtflags mask)
 Set flags of given field of stream. More...
 
void unsetf (const ios_base::fmtflags f)
 Unset flags of stream. More...
 
virtual void print (Ostream &os) const
 Print stream description to Ostream. More...
 
void print (Ostream &os, const int streamState) const
 Print information about the stream state bits. More...
 
InfoProxy< IOstreaminfo () const
 Return info proxy. More...
 
- Public Member Functions inherited from IOstreamOption
constexpr IOstreamOption (streamFormat fmt=streamFormat::ASCII, compressionType comp=compressionType::UNCOMPRESSED) noexcept
 
constexpr IOstreamOption (streamFormat fmt, compressionType comp, versionNumber ver) noexcept
 Construct from components (format, compression, version) More...
 
constexpr IOstreamOption (streamFormat fmt, versionNumber ver, compressionType comp=compressionType::UNCOMPRESSED) noexcept
 Construct from components (format, version, compression) More...
 
 IOstreamOption (const IOstreamOption &opt, streamFormat fmt) noexcept
 Copy construct with change of format. More...
 
streamFormat format () const noexcept
 Get the current stream format. More...
 
streamFormat format (const streamFormat fmt) noexcept
 Set the stream format. More...
 
streamFormat format (const word &formatName)
 Set the stream format from string value. More...
 
compressionType compression () const noexcept
 Get the stream compression. More...
 
compressionType compression (const compressionType comp) noexcept
 Set the stream compression. More...
 
compressionType compression (const word &compName)
 Set the stream compression from string value. More...
 
versionNumber version () const noexcept
 Get the stream version. More...
 
versionNumber version (const versionNumber ver) noexcept
 Set the stream version. More...
 
versionNumber version (const token &tok)
 Set the stream version from token. More...
 

Static Public Member Functions

static unsigned int defaultPrecision () noexcept
 Return the default precision. More...
 
static unsigned int defaultPrecision (unsigned int prec) noexcept
 Reset the default precision. More...
 
- Static Public Member Functions inherited from IOstreamOption
static streamFormat formatEnum (const word &formatName, const streamFormat deflt=streamFormat::ASCII)
 
static streamFormat formatEnum (const word &key, const dictionary &dict, const streamFormat deflt=streamFormat::ASCII)
 Failsafe construct streamFormat from optional dictionary lookup. More...
 
static compressionType compressionEnum (const word &compName, const compressionType deflt=compressionType::UNCOMPRESSED)
 The compression enum corresponding to the string. More...
 
static compressionType compressionEnum (const word &key, const dictionary &dict, const compressionType deflt=compressionType::UNCOMPRESSED)
 Failsafe construct compressionType from optional dictionary lookup. More...
 

Static Public Attributes

static unsigned int precision_
 Default precision. More...
 
- Static Public Attributes inherited from IOstreamOption
static const Enum< streamFormatformatNames
 Stream format names (ascii, binary) More...
 
static const versionNumber currentVersion
 The current version number (2.0) More...
 

Protected Member Functions

void setOpened () noexcept
 Set stream opened. More...
 
void setClosed () noexcept
 Set stream closed. More...
 
void setState (std::ios_base::iostate state) noexcept
 Set stream state. More...
 
void setGood () noexcept
 Set stream state to be good. More...
 

Protected Attributes

std::ios_base::iostate ioState_
 Mirror of internal stream io state. More...
 
streamAccess openClosed_
 The stream open/closed state. More...
 
unsigned char sizeofLabel_
 The sizeof (label), possibly read from the header. More...
 
unsigned char sizeofScalar_
 The sizeof (scalar), possibly read from the header. More...
 
label lineNumber_
 The file line. More...
 

Static Protected Attributes

static fileName staticName_
 Name for any generic stream - normally treat as readonly. More...
 

Detailed Description

An IOstream is an abstract base class for all input/output systems; be they streams, files, token lists etc.

The basic operations are construct, close, read token, read primitive and read binary block. In addition version control and line number counting is incorporated. Usually one would use the read primitive member functions, but if one were reading a stream on unknown data sequence one can read token by token, and then analyse.

Source files

Definition at line 79 of file IOstream.H.

Member Enumeration Documentation

◆ streamAccess

enum streamAccess : char

Enumeration for stream open/closed state.

Enumerator
CLOSED 

The stream is not open.

OPENED 

The stream is open.

Definition at line 88 of file IOstream.H.

Constructor & Destructor Documentation

◆ IOstream() [1/3]

IOstream ( const IOstream )
default

Copy construct.

◆ ~IOstream()

virtual ~IOstream ( )
virtualdefault

Destructor.

◆ IOstream() [2/3]

IOstream ( IOstreamOption  streamOpt = IOstreamOption())
inlineexplicit

Default construct (ASCII, uncompressed), construct with specified stream option

Definition at line 168 of file IOstream.H.

References IOstream::setBad().

Here is the call graph for this function:

◆ IOstream() [3/3]

Construct with format, version (compression)

Definition at line 181 of file IOstream.H.

Member Function Documentation

◆ setOpened()

void setOpened ( )
inlineprotectednoexcept

Set stream opened.

Definition at line 129 of file IOstream.H.

References IOstream::openClosed_, and IOstream::OPENED.

Referenced by IFstream::IFstream(), ISstream::ISstream(), ITstream::ITstream(), OFstream::OFstream(), OSstream::OSstream(), OTstream::OTstream(), OTstream::rewind(), and UIPstreamBase::UIPstreamBase().

Here is the caller graph for this function:

◆ setClosed()

void setClosed ( )
inlineprotectednoexcept

Set stream closed.

Definition at line 135 of file IOstream.H.

References IOstream::CLOSED, and IOstream::openClosed_.

Referenced by IFstream::IFstream(), and OFstream::OFstream().

Here is the caller graph for this function:

◆ setState()

void setState ( std::ios_base::iostate  state)
inlineprotectednoexcept

Set stream state.

Definition at line 141 of file IOstream.H.

References IOstream::ioState_.

Referenced by IFstream::IFstream(), ISstream::ISstream(), OFstream::OFstream(), and OSstream::OSstream().

Here is the caller graph for this function:

◆ setGood()

void setGood ( )
inlineprotectednoexcept

Set stream state to be good.

Definition at line 147 of file IOstream.H.

References IOstream::ioState_.

Referenced by ISstream::ISstream(), ITstream::ITstream(), OSstream::OSstream(), OTstream::OTstream(), IListStream::rewind(), OCountStream::rewind(), OListStream::rewind(), UIListStream::rewind(), UOListStream::rewind(), OTstream::rewind(), and UIPstreamBase::UIPstreamBase().

Here is the caller graph for this function:

◆ name() [1/2]

const Foam::fileName & name ( ) const
virtual

Return the name of the stream.

Useful for Fstream to remember the filename

Reimplemented in primitiveEntry, IFstream, OFstream, ISstream, OSstream, and ITstream.

Definition at line 40 of file IOstream.C.

References IOstream::staticName_.

Referenced by globalIndexAndTransform::addToTransformIndex(), mappedPatchBase::calcMapping(), hexRef8::checkMesh(), Foam::copyFilteredDict(), wallBoiling::correct(), ifeqEntry::execute(), includeEntry::execute(), Foam::operator>>(), IOobject::readHeader(), decomposedBlockData::readHeader(), and fvExpressionField::setField().

Here is the caller graph for this function:

◆ name() [2/2]

Foam::fileName & name ( )
virtual

Return stream name for modification.

Reimplemented in primitiveEntry, IFstream, OFstream, ISstream, OSstream, and ITstream.

Definition at line 46 of file IOstream.C.

◆ relativeName()

Foam::fileName relativeName ( ) const

Return the name of the stream relative to the current case.

Uses argList::envRelativePath()

Definition at line 52 of file IOstream.C.

References argList::envRelativePath(), and Foam::name().

Referenced by functionEntry::execute(), decomposedBlockData::readBlock(), IOobject::readHeader(), entry::reportReadWarning(), and IOerror::SafeFatalIOError().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ check()

bool check ( const char *  operation) const
virtual

Check IOstream status for given operation.

Print IOstream state or generate a FatalIOError when an error has occurred. The base implementation is a fatalCheck

Definition at line 58 of file IOstream.C.

References IOstream::check().

Referenced by IOstream::check(), CollidingParcel< ParcelType >::CollidingParcel(), CollisionRecordList< PairType, WallType >::CollisionRecordList(), DSMCParcel< ParcelType >::DSMCParcel(), eddy::eddy(), findCellParticle::findCellParticle(), HashTable< T * >::HashTable(), ignitionSite::ignitionSite(), injectedParticle::injectedParticle(), Foam::input(), KinematicParcel< ParcelType >::KinematicParcel(), kinematicParcelInjectionData::kinematicParcelInjectionData(), molecule::molecule(), MPPICParcel< ParcelType >::MPPICParcel(), objectMap::objectMap(), GeometricField< Type, PatchField, GeoMesh >::operator/=(), Foam::operator<<(), Foam::functionObjects::operator>>(), Foam::RBD::operator>>(), Foam::operator>>(), orientedType::orientedType(), Foam::output(), PairCollisionRecord< Type >::PairCollisionRecord(), pyramid< Point, PointRef, polygonRef >::pyramid(), ReactingHeterogeneousParcel< ParcelType >::ReactingHeterogeneousParcel(), ReactingMultiphaseParcel< ParcelType >::ReactingMultiphaseParcel(), reactingMultiphaseParcelInjectionData::reactingMultiphaseParcelInjectionData(), ReactingParcel< ParcelType >::ReactingParcel(), reactingParcelInjectionData::reactingParcelInjectionData(), SHA1Digest::read(), dimensioned< Type >::read(), dimensionSet::read(), IOPosition< CloudType >::readData(), lumpedPointIOMovement::readData(), particle< Type >::readData(), PackedList< Width >::setPair(), solidParticle::solidParticle(), SprayParcel< ParcelType >::SprayParcel(), streamLineParticle::streamLineParticle(), surfZoneIOList::surfZoneIOList(), ThermoParcel< ParcelType >::ThermoParcel(), thermoParcelInjectionData::thermoParcelInjectionData(), trackedParticle::trackedParticle(), VectorSpace< Form, Cmpt, Ncmpts >::VectorSpace(), wallBoundedParticle::wallBoundedParticle(), wallBoundedStreamLineParticle::wallBoundedStreamLineParticle(), WallCollisionRecord< Type >::WallCollisionRecord(), dictionaryListEntry::write(), SHA1Digest::write(), dimensionSet::write(), Foam::writeChars(), particle< Type >::writeCoordinates(), faBoundaryMesh::writeData(), polyBoundaryMesh::writeData(), DimensionedField< Type, GeoMesh >::writeData(), GeometricBoundaryField< Type, PatchField, GeoMesh >::writeEntry(), HashTable< T, Key, Hash >::writeKeys(), injectedParticle::writePosition(), particle< Type >::writePosition(), and passivePositionParticle::writePosition().

Here is the call graph for this function:

◆ fatalCheck()

bool fatalCheck ( const char *  operation) const

Check IOstream status for given operation.

Generate a FatalIOError when an error has occurred.

Definition at line 64 of file IOstream.C.

References Foam::exit(), Foam::FatalIOError, and FatalIOErrorInFunction.

Referenced by dictionaryEntry::dictionaryEntry(), functionEntry::execute(), entry::New(), Foam::operator>>(), primitiveEntry::read(), Foam::blockMeshTools::read(), decomposedBlockData::readBlockEntry(), PtrList< T >::readIstream(), PackedList< Width >::readList(), CircularBuffer< T >::readList(), LList< LListBase, T >::readList(), FixedList< T, N >::readList(), List< T >::readList(), UList< T >::readList(), and Matrix< Form, Type >::readMatrix().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ opened()

bool opened ( ) const
inlinenoexcept

True if stream has been opened.

Definition at line 221 of file IOstream.H.

References IOstream::openClosed_, and IOstream::OPENED.

Referenced by IFstream::IFstream(), and OFstream::OFstream().

Here is the caller graph for this function:

◆ closed()

bool closed ( ) const
inlinenoexcept

True if stream is closed.

Definition at line 227 of file IOstream.H.

References IOstream::CLOSED, and IOstream::openClosed_.

◆ good()

bool good ( ) const
inlinenoexcept

True if next operation might succeed.

Definition at line 233 of file IOstream.H.

References IOstream::ioState_.

Referenced by backwardDdtScheme< Type >::backwardDdtScheme(), topoSetSource::checkIs(), Foam::debug::controlDict(), dynamicCode::copyAndFilter(), dynamicCode::copyOrCreateFiles(), writeFile::createFile(), dynamicCode::createMakeFiles(), dynamicCode::createMakeOptions(), AC3DsurfaceFormatCore::cueTo(), directionalPressureGradientExplicitSource::directionalPressureGradientExplicitSource(), ensightSurfaceReader::geometry(), edgeMeshFormatsCore::getLineNoComment(), surfaceFormatsCore::getLineNoComment(), IFstream::IFstream(), meanVelocityForce::meanVelocityForce(), Reaction< ThermoType >::New(), OFstream::OFstream(), csvTableReader< Type >::operator()(), GlobalIOList< kinematicParcelInjectionData >::operator=(), rawIOField< Type >::rawIOField(), tabulated6DoFAcceleration::read(), tabulated6DoFMotion::read(), extendedEdgeMeshFormat::read(), extendedFeatureEdgeMeshFormat::read(), NASedgeFormat::read(), ABAQUSsurfaceFormat< Face >::read(), AC3DsurfaceFormat< Face >::read(), GTSsurfaceFormat< Face >::read(), NASsurfaceFormat< Face >::read(), OBJsurfaceFormat< Face >::read(), OFFsurfaceFormat< Face >::read(), STARCDsurfaceFormat< Face >::read(), VTKsurfaceFormat< Face >::read(), OBJedgeFormat::read(), STARCDedgeFormat::read(), VTKedgeFormat::read(), ABAQUSCore::readHelper::read(), edgeMeshFormat::read(), dictionary::read(), masterUncollatedFileOperation::readAndSend(), STARCDMeshReader::readBoundary(), ensightSurfaceReader::readCase(), STARCDMeshReader::readCells(), AC3DsurfaceFormatCore::readCmd(), GlobalIOField< Type >::readData(), IOmapDistributePolyMesh::readData(), IOmapDistributePolyMeshRef::readData(), ensightSurfaceReader::readField(), IOobject::readHeader(), STARCDCore::readHeader(), masterUncollatedFileOperation::readHeader(), STARCDsurfaceFormatCore::readInpCellTable(), ensightSurfaceReader::readLine(), STARCDMeshReader::readPoints(), STARCDCore::readPoints(), noiseFFT::setData(), ensightSurfaceReader::skip(), TableFile< Type >::TableFile(), graph::write(), dynamicIndexedOctree< Type >::write(), indexedOctree< Type >::write(), decomposedBlockData::writeBlocks(), refinementHistory::writeData(), polyTopoChanger::writeData(), AveragingMethod< Type >::writeData(), extendedFeatureEdgeMesh::writeData(), featureEdgeMesh::writeData(), baseIOdictionary::writeData(), GeometricField< Type, PatchField, GeoMesh >::writeData(), UniformDimensionedField< Type >::writeData(), faBoundaryMesh::writeData(), MRFZoneList::writeData(), porosityModelList::writeData(), IOPosition< CloudType >::writeData(), lumpedPointIOMovement::writeData(), rawIOField< Type >::writeData(), fieldDictionary::writeData(), decomposedBlockData::writeData(), IOField< Type >::writeData(), IOFieldRef< Type >::writeData(), IOList< T >::writeData(), IOListRef< T >::writeData(), IOMap< T >::writeData(), exprResultGlobals::writeData(), profiling::writeData(), cellModel::writeData(), IOmapDistributePolyMesh::writeData(), IOmapDistributePolyMeshRef::writeData(), polyBoundaryMesh::writeData(), coordinateSystems::writeData(), objective::writeData(), porousModel::writeData(), BlendedInterfacialModel< ModelType >::writeData(), dragModel::writeData(), virtualMassModel::writeData(), surfZoneIOList::writeData(), DimensionedField< Type, GeoMesh >::writeData(), dynamicCode::writeDigest(), pairPotential::writeEnergyAndForceTables(), dictionary::writeEntries(), IOobject::writeHeader(), Foam::writeJobDict(), and fileOperation::writeObject().

◆ eof()

◆ fail()

bool fail ( ) const
inlinenoexcept

True if next operation will fail.

Definition at line 245 of file IOstream.H.

References IOstream::ioState_.

Referenced by IOstream::operator bool(), and IOstream::operator!().

Here is the caller graph for this function:

◆ bad()

bool bad ( ) const
inlinenoexcept

True if stream is corrupted.

Definition at line 251 of file IOstream.H.

References IOstream::ioState_.

Referenced by Foam::getToken(), Foam::parseStream(), primitiveEntry::read(), GTSsurfaceFormat< Face >::read(), dictionary::read(), ISstream::read(), refinementHistory::readData(), extendedFeatureEdgeMesh::readData(), featureEdgeMesh::readData(), baseIOdictionary::readData(), fvExprDriverWriter::readData(), exprResultGlobals::readData(), error::write(), and IOerror::write().

Here is the caller graph for this function:

◆ operator bool()

operator bool ( ) const
inlineexplicitnoexcept

Return true if the stream has not failed.

Definition at line 257 of file IOstream.H.

References IOstream::fail().

Here is the call graph for this function:

◆ operator!()

bool operator! ( ) const
inlinenoexcept

Return true if the stream has failed.

Definition at line 263 of file IOstream.H.

References IOstream::fail().

Here is the call graph for this function:

◆ labelByteSize()

unsigned labelByteSize ( ) const
inlinenoexcept

The sizeof (label) in bytes associated with the stream.

Definition at line 272 of file IOstream.H.

References IOstream::sizeofLabel_.

Referenced by decomposedBlockData::readBlock().

Here is the caller graph for this function:

◆ scalarByteSize()

unsigned scalarByteSize ( ) const
inlinenoexcept

The sizeof (scalar) in bytes associated with the stream.

Definition at line 278 of file IOstream.H.

References IOstream::sizeofScalar_.

Referenced by decomposedBlockData::readBlock().

Here is the caller graph for this function:

◆ setLabelByteSize()

void setLabelByteSize ( unsigned  nbytes)
inlinenoexcept

Set the sizeof (label) in bytes associated with the stream.

Definition at line 284 of file IOstream.H.

References IOstream::sizeofLabel_.

Referenced by IOobject::readHeader().

Here is the caller graph for this function:

◆ setScalarByteSize()

void setScalarByteSize ( unsigned  nbytes)
inlinenoexcept

Set the sizeof (scalar) in bytes associated with the stream.

Definition at line 290 of file IOstream.H.

References IOstream::sizeofScalar_.

Referenced by IOobject::readHeader().

Here is the caller graph for this function:

◆ checkLabelSize()

std::enable_if< std::is_integral< T >::value, bool >::type checkLabelSize ( ) const
inlinenoexcept

◆ checkScalarSize()

std::enable_if< std::is_floating_point< T >::value, bool >::type checkScalarSize ( ) const
inlinenoexcept

◆ lineNumber() [1/3]

label lineNumber ( ) const
inlinenoexcept

Const access to the current stream line number.

Definition at line 318 of file IOstream.H.

References IOstream::lineNumber_.

Referenced by entry::checkITstream(), dictionary::checkITstream(), codeStream::evaluate(), ifeqEntry::execute(), functionEntry::execute(), NASedgeFormat::read(), NASsurfaceFormat< Face >::read(), IOobject::readHeader(), functionEntry::readLine(), entry::reportReadWarning(), and IOerror::SafeFatalIOError().

Here is the caller graph for this function:

◆ lineNumber() [2/3]

label & lineNumber ( )
inlinenoexcept

Non-const access to the current stream line number.

Definition at line 324 of file IOstream.H.

References IOstream::lineNumber_.

◆ lineNumber() [3/3]

label lineNumber ( const label  num)
inlinenoexcept

Set the stream line number.

Returns
the previous value

Definition at line 331 of file IOstream.H.

◆ flags() [1/2]

virtual ios_base::fmtflags flags ( ) const
pure virtual

Return flags of stream.

Implemented in dummyISstream, UIPstreamBase, UOPstreamBase, ISstream, OSstream, ITstream, and OTstream.

Referenced by IOstream::setf(), and IOstream::unsetf().

Here is the caller graph for this function:

◆ defaultPrecision() [1/2]

◆ defaultPrecision() [2/2]

static unsigned int defaultPrecision ( unsigned int  prec)
inlinestaticnoexcept

Reset the default precision.

Returns
the previous value

Definition at line 349 of file IOstream.H.

◆ setEof()

void setEof ( )
inlinenoexcept

Set stream state as reached 'eof'.

Definition at line 357 of file IOstream.H.

References IOstream::ioState_.

◆ setFail()

void setFail ( )
inlinenoexcept

Set stream state as 'failed'.

Definition at line 363 of file IOstream.H.

References IOstream::ioState_.

◆ setBad()

void setBad ( )
inline

Set stream state to be 'bad'.

Definition at line 369 of file IOstream.H.

References IOstream::ioState_.

Referenced by IFstream::IFstream(), IOstream::IOstream(), OFstream::OFstream(), and Foam::operator>>().

Here is the caller graph for this function:

◆ flags() [2/2]

virtual ios_base::fmtflags flags ( const ios_base::fmtflags  f)
pure virtual

Set flags of stream.

Implemented in OSstream, ISstream, dummyISstream, UIPstreamBase, UOPstreamBase, ITstream, and OTstream.

◆ setf() [1/2]

ios_base::fmtflags setf ( const ios_base::fmtflags  f)
inline

Set flags of stream.

Definition at line 378 of file IOstream.H.

References f(), and IOstream::flags().

Referenced by writeFile::initStream(), Foam::setf(), ensightWriter::writeCollated(), and ensightWriter::writeUncollated().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setf() [2/2]

ios_base::fmtflags setf ( const ios_base::fmtflags  f,
const ios_base::fmtflags  mask 
)
inline

Set flags of given field of stream.

Definition at line 384 of file IOstream.H.

References f(), and IOstream::flags().

Here is the call graph for this function:

◆ unsetf()

void unsetf ( const ios_base::fmtflags  f)
inline

Unset flags of stream.

Definition at line 394 of file IOstream.H.

References f(), and IOstream::flags().

Here is the call graph for this function:

◆ print() [1/2]

void print ( Ostream os) const
virtual

Print stream description to Ostream.

Reimplemented in IFstream, OFstream, IListStream, OCountStream, OListStream, UIListStream, UOListStream, UIPstreamBase, UOPstreamBase, ISstream, OSstream, prefixOSstream, IStringStream, OStringStream, ITstream, and OTstream.

Definition at line 80 of file IOstream.C.

References Foam::endl(), format(), and os().

Here is the call graph for this function:

◆ print() [2/2]

void print ( Ostream os,
const int  streamState 
) const

Print information about the stream state bits.

Definition at line 119 of file IOstream.C.

References Foam::endl(), and os().

Here is the call graph for this function:

◆ info()

InfoProxy< IOstream > info ( ) const
inline

Return info proxy.

Used to print IOstream information to a stream

Definition at line 413 of file IOstream.H.

Referenced by IFstream::IFstream(), MultiInteraction< CloudType >::info(), OFstream::OFstream(), Foam::operator<<(), dimensionSet::read(), and IOobject::writeHeader().

Here is the caller graph for this function:

Member Data Documentation

◆ precision_

unsigned int precision_
static

Default precision.

Definition at line 98 of file IOstream.H.

Referenced by IOstream::defaultPrecision(), functionObjectList::execute(), and OSstream::OSstream().

◆ staticName_

Foam::fileName staticName_
staticprotected

Name for any generic stream - normally treat as readonly.

Definition at line 106 of file IOstream.H.

Referenced by IOstream::name().

◆ ioState_

std::ios_base::iostate ioState_
protected

◆ openClosed_

streamAccess openClosed_
protected

The stream open/closed state.

Definition at line 112 of file IOstream.H.

Referenced by IOstream::closed(), IOstream::opened(), IOstream::setClosed(), and IOstream::setOpened().

◆ sizeofLabel_

unsigned char sizeofLabel_
protected

The sizeof (label), possibly read from the header.

Definition at line 115 of file IOstream.H.

Referenced by IOstream::checkLabelSize(), IOstream::labelByteSize(), and IOstream::setLabelByteSize().

◆ sizeofScalar_

unsigned char sizeofScalar_
protected

The sizeof (scalar), possibly read from the header.

Definition at line 118 of file IOstream.H.

Referenced by IOstream::checkScalarSize(), IOstream::scalarByteSize(), and IOstream::setScalarByteSize().

◆ lineNumber_

label lineNumber_
protected

The file line.

Definition at line 121 of file IOstream.H.

Referenced by IFstream::IFstream(), IOstream::lineNumber(), and OFstream::OFstream().


The documentation for this class was generated from the following files: