Loading...
Searching...
No Matches
IOstream Class Referenceabstract

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

#include <IOstream.H>

Inheritance diagram for IOstream:
Collaboration diagram for IOstream:

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 , COHERENT , UNKNOWN_FORMAT }
 Data format (ascii | binary | coherent). More...
enum  compressionType : char { UNCOMPRESSED = 0 , COMPRESSED }
 Compression treatment (UNCOMPRESSED | COMPRESSED). More...
enum  appendType : char {
  NO_APPEND = 0 , APPEND_APP , APPEND_ATE , NON_APPEND = NO_APPEND ,
  APPEND = APPEND_APP
}
 File appending (NO_APPEND | APPEND_APP | APPEND_ATE). More...
enum  atomicType : char { NON_ATOMIC = 0 , ATOMIC }
 Atomic operations (output). More...
enum class  floatFormat : unsigned { general = unsigned(0) , fixed = unsigned(std::ios_base::fixed) , scientific = unsigned(std::ios_base::scientific) }
 Float formats (eg, time directory name formats). More...

Public Member Functions

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

Static Public Member Functions

static unsigned int defaultPrecision () noexcept
 Return the default precision.
static unsigned int defaultPrecision (unsigned int prec) noexcept
 Reset the default precision.
static unsigned int minPrecision (unsigned int prec) noexcept
 Set the minimum default precision.
Static Public Member Functions inherited from IOstreamOption
static floatFormat floatFormatEnum (const word &fmtName, const floatFormat deflt=floatFormat::general)
 Lookup floatFormat enum corresponding to the string (general | fixed | scientific).
static floatFormat floatFormatEnum (const word &key, const dictionary &dict, const floatFormat deflt=floatFormat::general)
 getOrDefault floatFormat from dictionary, warn only on bad enumeration.
static streamFormat formatEnum (const word &fmtName, const streamFormat deflt=streamFormat::ASCII)
 Lookup streamFormat enum corresponding to the string (ascii | binary).
static streamFormat formatEnum (const word &key, const dictionary &dict, const streamFormat deflt=streamFormat::ASCII)
 getOrDefault streamFormat from dictionary, warn only on bad enumeration.
static compressionType compressionEnum (const word &compName, const compressionType deflt=compressionType::UNCOMPRESSED)
 The compression enum corresponding to the string.
static compressionType compressionEnum (const word &key, const dictionary &dict, const compressionType deflt=compressionType::UNCOMPRESSED)
 getOrDefault compressionType from dictionary, warn only on bad enumeration.

Static Public Attributes

static unsigned int precision_
 Default precision.
Static Public Attributes inherited from IOstreamOption
static const Enum< floatFormatfloatFormatNames
 Names for float formats (general, fixed, scientific).
static const Enum< streamFormatformatNames
 Stream format names (ascii, binary).
static const versionNumber currentVersion
 The current version number (2.0).

Protected Member Functions

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

Protected Attributes

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

Static Protected Attributes

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

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 82 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 93 of file IOstream.H.

Constructor & Destructor Documentation

◆ IOstream() [1/3]

IOstream ( const IOstream & )
default

Copy construct.

References IOstream().

Referenced by IOstream(), IOstream(), Istream::Istream(), and Ostream::Ostream().

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

◆ ~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 201 of file IOstream.H.

References CLOSED, ioState_, IOstreamOption::IOstreamOption(), lineNumber_, openClosed_, setBad(), sizeofLabel_, and sizeofScalar_.

Here is the call graph for this function:

◆ IOstream() [3/3]

Construct with format, version (compression).

Definition at line 216 of file IOstream.H.

References IOstream(), IOstreamOption::IOstreamOption(), and IOstreamOption::UNCOMPRESSED.

Here is the call graph for this function:

Member Function Documentation

◆ setOpened()

◆ setClosed()

void setClosed ( )
inlineprotectednoexcept

Set stream closed.

Definition at line 158 of file IOstream.H.

References CLOSED, Foam::noexcept, and openClosed_.

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

Here is the caller graph for this function:

◆ setState()

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

Set stream state.

Definition at line 166 of file IOstream.H.

References ioState_.

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

Here is the caller graph for this function:

◆ setGood()

◆ name()

const Foam::fileName & name ( ) const
virtual

The name of the stream.

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

Definition at line 33 of file IOstream.C.

References staticName_.

Referenced by ifeqEntry::execute(), ifeqEntry::execute(), includeEntry::execute(), includeEntry::execute(), Foam::operator>>(), decomposedBlockData::readHeader(), and IOobject::readHeader().

Here is the caller graph for this function:

◆ relativeName()

Foam::fileName relativeName ( ) const

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

Uses argList::envRelativePath()

Definition at line 39 of file IOstream.C.

References argList::envRelativePath(), and name.

Referenced by functionEntry::execute(), functionEntry::execute(), fatalCheck(), fatalCheckNativeSizes(), Foam::operator>>(), decomposedBlockData::readBlock(), IOobject::readHeader(), primitiveEntry::relativeName(), 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 45 of file IOstream.C.

References fatalCheck().

Referenced by CollidingParcel< ParcelType >::CollidingParcel(), CollisionRecordList< PairType, WallType >::CollisionRecordList(), DSMCParcel< ParcelType >::DSMCParcel(), eddy::eddy(), findCellParticle::findCellParticle(), ignitionSite::ignitionSite(), ignitionSite::ignitionSite(), injectedParticle::injectedParticle(), KinematicParcel< ParcelType >::KinematicParcel(), kinematicParcelInjectionData::kinematicParcelInjectionData(), molecule::molecule(), MPPICParcel< ParcelType >::MPPICParcel(), objectMap::objectMap(), magnet::operator>>, Foam::operator>>(), Foam::operator>>(), Foam::operator>>(), Foam::operator>>(), Foam::operator>>(), Foam::operator>>(), Foam::operator>>(), Foam::operator>>(), Foam::operator>>(), Foam::operator>>(), Foam::operator>>(), Foam::operator>>(), Foam::operator>>(), Foam::operator>>(), Foam::operator>>(), Foam::operator>>(), Foam::operator>>(), Foam::operator>>(), Foam::operator>>(), Foam::operator>>(), Foam::operator>>(), Foam::operator>>(), Foam::operator>>(), Foam::operator>>(), Foam::operator>>(), Foam::operator>>(), Foam::operator>>(), Foam::operator>>(), Foam::operator>>(), Foam::operator>>(), Foam::operator>>(), Foam::operator>>(), Foam::operator>>(), Foam::operator>>(), Foam::operator>>(), Foam::operator>>(), Foam::operator>>(), Foam::operator>>(), Foam::operator>>(), PointIndexHit< point >::operator>>, orientedType::orientedType(), PairCollisionRecord< Type >::PairCollisionRecord(), pointBoundaryMesh::pointBoundaryMesh(), ReactingHeterogeneousParcel< ParcelType >::ReactingHeterogeneousParcel(), ReactingMultiphaseParcel< ParcelType >::ReactingMultiphaseParcel(), reactingMultiphaseParcelInjectionData::reactingMultiphaseParcelInjectionData(), ReactingParcel< ParcelType >::ReactingParcel(), reactingParcelInjectionData::reactingParcelInjectionData(), dimensioned< Type >::read(), dimensioned< Type >::read(), dimensioned< Type >::read(), dimensionSet::read(), dimensionSet::read(), SHA1Digest::read(), IOPosition< CloudType >::readData(), lumpedPointIOMovement::readData(), particle< Type >::readData(), PackedList< Width >::setPair(), solidParticle::solidParticle(), SprayParcel< ParcelType >::SprayParcel(), streamLineParticle::streamLineParticle(), ThermoParcel< ParcelType >::ThermoParcel(), thermoParcelInjectionData::thermoParcelInjectionData(), trackedParticle::trackedParticle(), Tuple2< scalar, vector >::Tuple2(), wallBoundedParticle::wallBoundedParticle(), wallBoundedStreamLineParticle::wallBoundedStreamLineParticle(), and WallCollisionRecord< Type >::WallCollisionRecord().

Here is the call graph for this function:

◆ fatalCheck()

◆ opened()

bool opened ( ) const
inlinenoexcept

True if stream has been opened.

Definition at line 265 of file IOstream.H.

References Foam::noexcept, openClosed_, and OPENED.

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

Here is the caller graph for this function:

◆ closed()

bool closed ( ) const
inlinenoexcept

True if stream is closed.

Definition at line 273 of file IOstream.H.

References CLOSED, Foam::noexcept, and openClosed_.

Referenced by print().

Here is the caller graph for this function:

◆ good()

bool good ( ) const
inlinenoexcept

True if next operation might succeed.

Definition at line 281 of file IOstream.H.

References ioState_, and Foam::noexcept.

Referenced by abaqusMeshSet::abaqusMeshSet(), dictionaryValue::apply(), fileRegEx::apply(), backwardDdtScheme< Type >::backwardDdtScheme(), topoSetSource::checkIs(), Foam::debug::controlDict(), dynamicCode::copyAndFilter(), dynamicCode::copyOrCreateFiles(), AC3DsurfaceFormatCore::cueTo(), directionalPressureGradientExplicitSource::directionalPressureGradientExplicitSource(), fanMomentumSource::fanMomentumSource(), ISstream::get(), edgeMeshFormatsCore::getLineNoComment(), surfaceFormatsCore::getLineNoComment(), decomposedBlockData::getNumBlocks(), IFstream::IFstream(), writeFile::newFileAtTime(), OFstream::OFstream(), csvTableReader< Type >::operator()(), IFstream::operator()(), Istream::operator()(), foamReport::parseTemplate(), print(), dictionary::read(), ABAQUSCore::readHelper::read(), ABAQUSsurfaceFormat< Face >::read(), AC3DsurfaceFormat< Face >::read(), edgeMeshFormat::read(), extendedEdgeMeshFormat::read(), extendedFeatureEdgeMeshFormat::read(), GTSsurfaceFormat< Face >::read(), NASedgeFormat::read(), NASsurfaceFormat< Face >::read(), OBJedgeFormat::read(), OBJsurfaceFormat< Face >::read(), OFFsurfaceFormat< Face >::read(), STARCDedgeFormat::read(), STARCDsurfaceFormat< Face >::read(), VTKedgeFormat::read(), VTKsurfaceFormat< Face >::read(), tabulated6DoFMotion::read(), tabulated6DoFAcceleration::read(), token::read(), masterUncollatedFileOperation::readAndSend(), STARCDMeshReader::readBoundary(), ensightSurfaceReader::readCase(), STARCDMeshReader::readCells(), AC3DsurfaceFormatCore::readCmd(), IFstream::readContents(), GlobalIOField< Type >::readData(), GlobalIOList< Type >::readData(), IOmapDistributePolyMesh::readData(), IOmapDistributePolyMeshRef::readData(), UniformDimensionedField< Type >::readData(), ensightSurfaceReader::readGeometry(), STARCDCore::readHeader(), masterUncollatedFileOperation::readHeader(), IOobject::readHeader(), STARCDsurfaceFormatCore::readInpCellTable(), topoSet::readIOcontents(), ensightSurfaceReader::readLine(), STARCDCore::readPoints(), STARCDMeshReader::readPoints(), OFstream::rewind(), noiseFFT::setData(), Reaction< ReactionThermo >::setLRhs(), decomposedBlockData::skipBlockEntry(), TableFile< Type >::TableFile(), and graph::write().

◆ eof()

bool eof ( ) const
inlinenoexcept

True if end of input seen.

Definition at line 289 of file IOstream.H.

References ioState_, and Foam::noexcept.

Referenced by Cloud< ParcelType >::autoMap(), backwardDdtScheme< Type >::backwardDdtScheme(), topoSetSource::checkIs(), divScheme< Type >::divScheme(), divScheme< Type >::divScheme(), ifeqEntry::evaluate(), ifeqEntry::execute(), fusedGaussGrad< Type >::fusedGaussGrad(), gaussGrad< Type >::gaussGrad(), gaussGrad< Type >::gaussGrad(), laplacianScheme< Type >::laplacianScheme(), laplacianScheme< scalar, scalar >::laplacianScheme(), edgeInterpolationScheme< Type >::New(), edgeInterpolationScheme< Type >::New(), entry::New(), convectionScheme< Type >::New(), divScheme< Type >::New(), faD2dt2Scheme< Type >::New(), faDdtScheme< Type >::New(), gradScheme< Type >::New(), laplacianScheme< Type >::New(), lnGradScheme< Type >::New(), convectionScheme< Type >::New(), convectionScheme< Type >::New(), d2dt2Scheme< Type >::New(), ddtScheme< Type >::New(), divScheme< Type >::New(), gradScheme< Type >::New(), laplacianScheme< Type, GType >::New(), snGradScheme< Type >::New(), limitedSurfaceInterpolationScheme< Type >::New(), limitedSurfaceInterpolationScheme< Type >::New(), surfaceInterpolationScheme< Type >::New(), surfaceInterpolationScheme< Type >::New(), RecycleInteraction< CloudType >::postEvolve(), print(), dictionary::read(), ITstream::read(), UIPstream::read(), Foam::readEnsightString(), noiseFFT::setData(), and solution::upgradeSolverDict().

Here is the caller graph for this function:

◆ fail()

bool fail ( ) const
inlinenoexcept

True if next operation will fail.

Definition at line 297 of file IOstream.H.

References ioState_, and Foam::noexcept.

Referenced by operator bool(), operator!(), and print().

Here is the caller graph for this function:

◆ bad()

◆ operator bool()

operator bool ( ) const
inlineexplicitnoexcept

True if the stream has not failed.

Definition at line 313 of file IOstream.H.

References fail(), and Foam::noexcept.

Here is the call graph for this function:

◆ operator!()

bool operator! ( ) const
inlinenoexcept

True if the stream has failed.

Definition at line 321 of file IOstream.H.

References fail(), and Foam::noexcept.

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 332 of file IOstream.H.

References Foam::noexcept, and sizeofLabel_.

Referenced by ITstream::extract(), fatalCheckNativeSizes(), Foam::Detail::readContiguous< Foam::pointConstraint >(), decomposedBlockData::readBlock(), and Foam::readRawLabel().

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 340 of file IOstream.H.

References Foam::noexcept, and sizeofScalar_.

Referenced by ITstream::extract(), fatalCheckNativeSizes(), Foam::Detail::readContiguous< Foam::pointConstraint >(), and 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 348 of file IOstream.H.

References sizeofLabel_.

Referenced by ITstream::extract(), and 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 356 of file IOstream.H.

References sizeofScalar_.

Referenced by ITstream::extract(), and IOobject::readHeader().

Here is the caller graph for this function:

◆ checkLabelSize()

template<class T, class = std::enable_if_t<std::is_integral_v<T>>>
bool checkLabelSize ( ) const
inlinenoexcept

Test if the label byte-size associated with the stream is the same as the given type.

Definition at line 367 of file IOstream.H.

References Foam::noexcept, sizeofLabel_, and Foam::T().

Here is the call graph for this function:

◆ checkScalarSize()

template<class T, class = std::enable_if_t<std::is_floating_point_v<T>>>
bool checkScalarSize ( ) const
inlinenoexcept

Test if the scalar byte-size associated with the stream is the same as the given type.

Definition at line 377 of file IOstream.H.

References Foam::noexcept, sizeofScalar_, and Foam::T().

Here is the call graph for this function:

◆ checkNativeSizes()

bool checkNativeSizes ( ) const
inlinenoexcept

Test if the label/scalar byte-size associated with the stream are the native label/scalar sizes.

Definition at line 386 of file IOstream.H.

References Foam::noexcept, sizeofLabel_, and sizeofScalar_.

Referenced by fatalCheckNativeSizes(), and Foam::Detail::readContiguous< Foam::pointConstraint >().

Here is the caller graph for this function:

◆ fatalCheckNativeSizes()

◆ lineNumber() [1/3]

◆ lineNumber() [2/3]

label & lineNumber ( )
inlinenoexcept

Non-const access to the current stream line number.

Definition at line 417 of file IOstream.H.

References lineNumber_, and Foam::noexcept.

◆ lineNumber() [3/3]

label lineNumber ( const label num)
inlinenoexcept

Set the stream line number.

Returns
the previous value

Definition at line 427 of file IOstream.H.

References lineNumber_.

◆ defaultPrecision() [1/2]

◆ defaultPrecision() [2/2]

unsigned int defaultPrecision ( unsigned int prec)
inlinestaticnoexcept

Reset the default precision.

Returns
the previous default precision

Definition at line 447 of file IOstream.H.

References precision_.

◆ minPrecision()

minPrecision ( unsigned int prec)
inlinestaticnoexcept

Set the minimum default precision.

Returns
the previous default precision

Definition at line 459 of file IOstream.H.

References precision_.

◆ setEof()

void setEof ( )
inlinenoexcept

Set stream state as reached 'eof'.

Definition at line 472 of file IOstream.H.

References ioState_, and Foam::noexcept.

Referenced by ITstream::read(), primitiveEntry::read(), UIPstreamBase::rewind(), ITstream::seek(), and ITstream::skip().

Here is the caller graph for this function:

◆ setFail()

void setFail ( )
inlinenoexcept

Set stream state as 'failed'.

Definition at line 480 of file IOstream.H.

References ioState_, and Foam::noexcept.

◆ setBad()

◆ flags() [1/2]

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

Return current stream flags.

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

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

Here is the caller graph for this function:

◆ flags() [2/2]

virtual std::ios_base::fmtflags flags ( std::ios_base::fmtflags )
pure virtual

Set stream flags, return old stream flags.

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

◆ setf() [1/2]

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

Set stream flag(s), return old stream flags.

Definition at line 506 of file IOstream.H.

References f(), and flags().

Referenced by Foam::setf(), and objective::write().

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

◆ setf() [2/2]

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

Set stream flag(s) with mask, return old stream flags.

Definition at line 514 of file IOstream.H.

References f(), and flags().

Here is the call graph for this function:

◆ unsetf()

std::ios_base::fmtflags unsetf ( std::ios_base::fmtflags f)
inline

Unset stream flags, return old stream flags.

Definition at line 526 of file IOstream.H.

References f(), and 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 ICharStream, IFstream, ISpanStream, ISstream, IStringStream, ITstream, OCharStream, OCountStream, OFstream, OSpanStream, OSstream, OStringStream, OTstream, prefixOSstream, UIPstreamBase, and UOPstreamBase.

Definition at line 87 of file IOstream.C.

References bad(), closed(), Foam::endl(), eof(), fail(), format(), good(), lineNumber(), opened(), os(), and IOstreamOption::version().

Referenced by ISstream::print(), IStringStream::print(), ITstream::print(), OSstream::print(), OStringStream::print(), and OTstream::print().

Here is the call graph for this function:
Here is the caller 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 126 of file IOstream.C.

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

Here is the call graph for this function:

◆ info()

InfoProxy< IOstream > info ( ) const
inlinenoexcept

Return info proxy, used to print IOstream information to a stream.

Definition at line 551 of file IOstream.H.

References Foam::noexcept.

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

Here is the caller graph for this function:

Member Data Documentation

◆ precision_

unsigned int precision_
static

Default precision.

Definition at line 105 of file IOstream.H.

Referenced by defaultPrecision(), defaultPrecision(), functionObjectList::execute(), and minPrecision().

◆ staticName_

Foam::fileName staticName_
staticprotected

Name for any generic stream - normally treat as readonly.

Definition at line 115 of file IOstream.H.

Referenced by name().

◆ ioState_

std::ios_base::iostate ioState_
protected

Mirror of internal stream io state.

Definition at line 120 of file IOstream.H.

Referenced by bad(), eof(), fail(), good(), IOstream(), setBad(), setEof(), setFail(), setGood(), and setState().

◆ openClosed_

streamAccess openClosed_
protected

The stream open/closed state.

Definition at line 125 of file IOstream.H.

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

◆ sizeofLabel_

unsigned char sizeofLabel_
protected

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

Definition at line 130 of file IOstream.H.

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

◆ sizeofScalar_

unsigned char sizeofScalar_
protected

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

Definition at line 135 of file IOstream.H.

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

◆ lineNumber_


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