The IOstreamOption is a simple container for options an IOstream can normally have. More...
Classes | |
class | versionNumber |
Representation of a major/minor version number. More... | |
Public Types | |
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 | |
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 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 const Enum< streamFormat > | formatNames |
Stream format names (ascii, binary) More... | |
static const versionNumber | currentVersion |
The current version number (2.0) More... | |
The IOstreamOption is a simple container for options an IOstream can normally have.
The format (ASCII | BINARY) is typically controlled by enumerated names (ascii, binary).
The compression (UNCOMPRESSED | COMPRESSED) is typically controlled by switch values (true/false, on/off, ...).
Definition at line 63 of file IOstreamOption.H.
enum streamFormat : char |
Data format (ascii | binary)
Enumerator | |
---|---|
ASCII | "ascii" (normal default) |
BINARY | "binary" |
Definition at line 70 of file IOstreamOption.H.
enum compressionType : char |
Compression treatment (UNCOMPRESSED | COMPRESSED)
Enumerator | |
---|---|
UNCOMPRESSED | compression = false |
COMPRESSED | compression = true |
Definition at line 77 of file IOstreamOption.H.
|
inlineconstexprnoexcept |
Default construct (ASCII, UNCOMPRESSED, currentVersion) or construct with format, compression
Definition at line 196 of file IOstreamOption.H.
|
inlineconstexprnoexcept |
Construct from components (format, compression, version)
Definition at line 208 of file IOstreamOption.H.
|
inlineconstexprnoexcept |
Construct from components (format, version, compression)
Definition at line 221 of file IOstreamOption.H.
|
inlinenoexcept |
Copy construct with change of format.
Definition at line 233 of file IOstreamOption.H.
|
static |
The stream format enum corresponding to the string (ascii | binary).
If the string is not recognized, emit warning and return default. Silent if the string itself is empty.
Definition at line 53 of file IOstreamOption.C.
References WarningInFunction.
Referenced by vtkCloud::read(), vtkWrite::read(), and vtkWriter::vtkWriter().
|
static |
Failsafe construct streamFormat from optional dictionary lookup.
key | Lookup key. Uses LITERAL (not REGEX) |
dict | dictionary |
Definition at line 80 of file IOstreamOption.C.
References dict.
|
static |
The compression enum corresponding to the string.
Expects switch values (true/false, on/off, ...)
If the string is not recognized, emit warning and return default. Silent if the string itself is empty.
Definition at line 92 of file IOstreamOption.C.
References Foam::ListOps::find(), Switch::good(), Foam::nl, and WarningInFunction.
|
static |
Failsafe construct compressionType from optional dictionary lookup.
key | Lookup key. Uses LITERAL (not REGEX) |
dict | dictionary |
Definition at line 127 of file IOstreamOption.C.
References dict.
|
inlinenoexcept |
Get the current stream format.
Definition at line 289 of file IOstreamOption.H.
Referenced by collatedFileOperation::appendObject(), CollidingParcel< ParcelType >::CollidingParcel(), 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(), decomposedBlockData::readBlock(), 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(), OBJsurfaceFormat< Face >::write(), X3DsurfaceFormat< Face >::write(), SMESHsurfaceFormat< Face >::write(), AC3DsurfaceFormat< Face >::write(), OFFsurfaceFormat< Face >::write(), GTSsurfaceFormat< Face >::write(), TRIsurfaceFormat< Face >::write(), ABAQUSsurfaceFormat< Face >::write(), STARCDsurfaceFormat< Face >::write(), NASsurfaceFormat< Face >::write(), csvTableReader< Type >::write(), STLsurfaceFormat< Face >::write(), dimensionSet::write(), Foam::ensightOutput::writeCloudPositions(), particle< Type >::writeCoordinates(), decomposedBlockData::writeData(), CSV< Type >::writeData(), exprResultGlobals::writeData(), exprResult::writeDict(), UList< Foam::wordRe >::writeEntry(), Time::writeFormat(), decomposedBlockData::writeHeader(), IOobject::writeHeader(), IndirectListBase< T, Addr >::writeList(), PackedList< 2 >::writeList(), FixedList< Type, 3 >::writeList(), UList< Foam::wordRe >::writeList(), bitSet::writeList(), Matrix< RectangularMatrix< Type >, Type >::writeMatrix(), CompactIOField< T, BaseType >::writeObject(), CompactIOList< face, label >::writeObject(), decomposedBlockData::writeObject(), rigidBodyMeshMotionSolver::writeObject(), rigidBodyMeshMotion::writeObject(), distributedTriSurfaceMesh::writeObject(), injectedParticle::writePosition(), particle< Type >::writePosition(), and exprResult::writeValue().
|
inlinenoexcept |
|
inline |
Set the stream format from string value.
If the string is not recognized, emit warning and leave unchanged. Silent if the string itself is empty.
Definition at line 307 of file IOstreamOption.H.
|
inlinenoexcept |
Get the stream compression.
Definition at line 315 of file IOstreamOption.H.
Referenced by IFstream::IFstream(), masterUncollatedFileOperation::readAndSend(), Time::readDict(), STLsurfaceFormat< Face >::write(), Time::writeCompression(), and polyBoundaryMesh::writeObject().
|
inlinenoexcept |
Set the stream compression.
Definition at line 322 of file IOstreamOption.H.
|
inline |
Set the stream compression from string value.
If the string is not recognized, emit warning and leave unchanged. Silent if the string itself is empty.
Definition at line 333 of file IOstreamOption.H.
|
inlinenoexcept |
Get the stream version.
Definition at line 341 of file IOstreamOption.H.
Referenced by collatedFileOperation::appendObject(), decomposedBlockData::numBlocks(), decomposedBlockData::readBlock(), Time::readDict(), IOobject::readHeader(), Foam::setversion(), decomposedBlockData::writeData(), IOobject::writeHeader(), Time::writeVersion(), and threadedCollatedOFstream::~threadedCollatedOFstream().
|
inlinenoexcept |
|
inline |
Set the stream version from token.
Definition at line 357 of file IOstreamOption.H.
|
static |
Stream format names (ascii, binary)
Definition at line 165 of file IOstreamOption.H.
Referenced by Foam::operator<<(), exprResult::writeDict(), and exprResult::writeValue().
|
static |
The current version number (2.0)
Definition at line 168 of file IOstreamOption.H.
Referenced by ITstream::parse(), decomposedBlockData::readBlock(), FIREMeshWriter::write(), and lumpedPointMovement::writeData().