IOstreamOption Class Reference

The IOstreamOption is a simple container for options an IOstream can normally have. For example, ascii/binary, uncompressed/compressed, ... More...

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

Classes

class  versionNumber
 Representation of a major/minor version number. More...
 

Public Types

enum  streamFormat : char { ASCII, BINARY }
 Data format (ascii | binary) More...
 
enum  compressionType : char { UNCOMPRESSED = 0, COMPRESSED }
 Compression treatment (UNCOMPRESSED | COMPRESSED) More...
 

Public Member Functions

 IOstreamOption () noexcept
 Construct null. (default: ASCII, uncompressed, currentVersion) More...
 
 IOstreamOption (streamFormat format) noexcept
 Construct with format. (default: uncompressed, currentVersion) More...
 
 IOstreamOption (streamFormat format, compressionType compression, versionNumber version=currentVersion) noexcept
 Construct with format and compression, optionally with version. More...
 
 IOstreamOption (streamFormat format, versionNumber version, compressionType compression) noexcept
 Construct with format, version, compression. More...
 
streamFormat format () const noexcept
 Get the current stream format. More...
 
streamFormat format (const streamFormat format) 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 &compressionName)
 Set the stream compression, from string value. More...
 
versionNumber version () const noexcept
 Get the stream version. More...
 
versionNumber version (const versionNumber verNum) noexcept
 Set the stream version. More...
 

Static Public Member Functions

static streamFormat formatEnum (const word &formatName)
 The stream format enum corresponding to the string. More...
 
static compressionType compressionEnum (const word &compName)
 The compression enum corresponding to the string. More...
 

Static Public Attributes

static const Enum< streamFormatformatNames
 Stream format names (ascii, binary) More...
 
static const versionNumber originalVersion
 The original version number. More...
 
static const versionNumber currentVersion
 The current version number. More...
 

Detailed Description

The IOstreamOption is a simple container for options an IOstream can normally have. For example, ascii/binary, uncompressed/compressed, ...

Source files

Definition at line 57 of file IOstreamOption.H.

Member Enumeration Documentation

◆ streamFormat

enum streamFormat : char

Data format (ascii | binary)

Enumerator
ASCII 

"ascii"

BINARY 

"binary"

Definition at line 64 of file IOstreamOption.H.

◆ compressionType

enum compressionType : char

Compression treatment (UNCOMPRESSED | COMPRESSED)

Enumerator
UNCOMPRESSED 

compression = false

COMPRESSED 

compression = true

Definition at line 71 of file IOstreamOption.H.

Constructor & Destructor Documentation

◆ IOstreamOption() [1/4]

IOstreamOption ( )
inlinenoexcept

Construct null. (default: ASCII, uncompressed, currentVersion)

Definition at line 217 of file IOstreamOption.H.

◆ IOstreamOption() [2/4]

IOstreamOption ( streamFormat  format)
inlineexplicitnoexcept

Construct with format. (default: uncompressed, currentVersion)

Definition at line 225 of file IOstreamOption.H.

◆ IOstreamOption() [3/4]

IOstreamOption ( streamFormat  format,
compressionType  compression,
versionNumber  version = currentVersion 
)
inlinenoexcept

Construct with format and compression, optionally with version.

Definition at line 234 of file IOstreamOption.H.

◆ IOstreamOption() [4/4]

IOstreamOption ( streamFormat  format,
versionNumber  version,
compressionType  compression 
)
inlinenoexcept

Construct with format, version, compression.

Definition at line 247 of file IOstreamOption.H.

Member Function Documentation

◆ formatEnum()

Foam::IOstreamOption::streamFormat formatEnum ( const word formatName)
static

The stream format enum corresponding to the string.

Expected "ascii", "binary"

Definition at line 56 of file IOstreamOption.C.

References Foam::endl(), IOstreamOption::formatNames, Enum< EnumType >::found(), and WarningInFunction.

Referenced by vtkCloud::read(), vtkWrite::read(), and decomposedBlockData::writeData().

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

◆ compressionEnum()

Foam::IOstreamOption::compressionType compressionEnum ( const word compName)
static

The compression enum corresponding to the string.

Expected "true", "false", "on", "off", etc.

Definition at line 73 of file IOstreamOption.C.

References Foam::endl(), Switch::valid(), and WarningInFunction.

Here is the call graph for this function:

◆ format() [1/3]

streamFormat format ( ) const
inlinenoexcept

Get the current stream format.

Definition at line 273 of file IOstreamOption.H.

Referenced by collatedFileOperation::appendObject(), CollidingParcel< ParcelType >::CollidingParcel(), CSV< Type >::CSV(), DSMCParcel< ParcelType >::DSMCParcel(), codeStream::evaluate(), findCellParticle::findCellParticle(), FIRECore::getFireLabel(), FIRECore::getFirePoint(), FIRECore::getFireString(), injectedParticle::injectedParticle(), KinematicParcel< ParcelType >::KinematicParcel(), molecule::molecule(), MPPICParcel< ParcelType >::MPPICParcel(), decomposedBlockData::numBlocks(), Foam::operator<<(), Foam::operator>>(), particle< Type >::particle(), Foam::BitOps::print(), Foam::processFlags(), FIRECore::putFireLabel(), FIRECore::putFireLabels(), FIRECore::putFirePoint(), FIRECore::putFireString(), ReactingParcel< ParcelType >::ReactingParcel(), ensightReadFile::read(), PackedList< 2 >::read(), exprResultGlobals::readData(), Time::readDict(), IOobject::readHeader(), Matrix< RectangularMatrix< Type >, Type >::readMatrix(), Foam::setformat(), solidParticle::solidParticle(), SprayParcel< ParcelType >::SprayParcel(), ThermoParcel< ParcelType >::ThermoParcel(), trackedParticle::trackedParticle(), wallBoundedParticle::wallBoundedParticle(), csvTableReader< Type >::write(), dimensionSet::write(), Foam::ensightOutput::writeCloudPositions(), particle< Type >::writeCoordinates(), decomposedBlockData::writeData(), CSV< Type >::writeData(), exprResultGlobals::writeData(), exprResult::writeDict(), UList< Foam::wordRe >::writeEntry(), Time::writeFormat(), IOobject::writeHeader(), IndirectListBase< T, sliceRange >::writeList(), FixedList< Type, 3 >::writeList(), PackedList< 2 >::writeList(), UList< Foam::wordRe >::writeList(), bitSet::writeList(), Matrix< RectangularMatrix< Type >, Type >::writeMatrix(), injectedParticle::writePosition(), particle< Type >::writePosition(), and exprResult::writeValue().

◆ format() [2/3]

streamFormat format ( const streamFormat  format)
inlinenoexcept

Set the stream format.

Returns
the previous value

Definition at line 280 of file IOstreamOption.H.

◆ format() [3/3]

streamFormat format ( const word formatName)
inline

Set the stream format, from string value.

Returns
the previous value

Definition at line 289 of file IOstreamOption.H.

◆ compression() [1/3]

compressionType compression ( ) const
inlinenoexcept

Get the stream compression.

Definition at line 297 of file IOstreamOption.H.

Referenced by Time::readDict(), and Time::writeCompression().

Here is the caller graph for this function:

◆ compression() [2/3]

compressionType compression ( const compressionType  comp)
inlinenoexcept

Set the stream compression.

Returns
the previous value

Definition at line 304 of file IOstreamOption.H.

◆ compression() [3/3]

compressionType compression ( const word compressionName)
inline

Set the stream compression, from string value.

Returns
the previous value

Definition at line 313 of file IOstreamOption.H.

◆ version() [1/2]

versionNumber version ( ) const
inlinenoexcept

Get the stream version.

Definition at line 321 of file IOstreamOption.H.

Referenced by collatedFileOperation::appendObject(), Field< Foam::Vector2D >::Field(), decomposedBlockData::numBlocks(), Foam::operator>>(), Time::readDict(), IOobject::readHeader(), mappedPatchBase::readListOrField(), Foam::setversion(), decomposedBlockData::writeData(), IOobject::writeHeader(), Time::writeVersion(), and threadedCollatedOFstream::~threadedCollatedOFstream().

Here is the caller graph for this function:

◆ version() [2/2]

versionNumber version ( const versionNumber  verNum)
inlinenoexcept

Set the stream version.

Returns
the previous value

Definition at line 328 of file IOstreamOption.H.

Member Data Documentation

◆ formatNames

const Foam::Enum< Foam::IOstreamOption::streamFormat > formatNames
static

Stream format names (ascii, binary)

Definition at line 187 of file IOstreamOption.H.

Referenced by IOstreamOption::formatEnum(), Foam::operator<<(), exprResult::writeDict(), and exprResult::writeValue().

◆ originalVersion

const Foam::IOstreamOption::versionNumber originalVersion
static

The original version number.

Definition at line 190 of file IOstreamOption.H.

Referenced by Foam::operator>>().

◆ currentVersion


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