45#ifndef IOstreamOption_H
46#define IOstreamOption_H
58template<
class EnumType>
class Enum;
111 number_(10*ver + 0.001)
127 std::string
str()
const
131 std::to_string(
int(number_ / 10))
133 + std::to_string(
int(number_ % 10))
155 return number_ - other.number_;
233 version_(opt.version_),
235 compression_(opt.compression_)
250 const word& formatName,
271 const word& compName,
370Ostream&
operator<<(Ostream&
os,
const IOstreamOption::versionNumber& ver);
378inline bool operator==
388inline bool operator!=
408inline bool operator<=
428inline bool operator>=
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
Representation of a major/minor version number.
constexpr versionNumber(const float ver) noexcept
Construct from floating-point version number.
static versionNumber canonical(int verNum) noexcept
From canonical integer value to version.
constexpr versionNumber(int major, int minor) noexcept
Construct from major, number.
constexpr versionNumber() noexcept
int canonical() const noexcept
From version to canonical integer value.
int compare(const versionNumber &other) const noexcept
Compare differences in the versions.
std::string str() const
A string representation as major.minor.
The IOstreamOption is a simple container for options an IOstream can normally have.
versionNumber version() const noexcept
Get the stream version.
compressionType compression() const noexcept
Get the stream compression.
streamFormat format() const noexcept
Get the current stream format.
static compressionType compressionEnum(const word &compName, const compressionType deflt=compressionType::UNCOMPRESSED)
The compression enum corresponding to the string.
IOstreamOption(const IOstreamOption &opt, streamFormat fmt) noexcept
Copy construct with change of format.
constexpr IOstreamOption(streamFormat fmt, compressionType comp, versionNumber ver) noexcept
Construct from components (format, compression, version)
streamFormat
Data format (ascii | binary)
@ ASCII
"ascii" (normal default)
static streamFormat formatEnum(const word &formatName, const streamFormat deflt=streamFormat::ASCII)
static const Enum< streamFormat > formatNames
Stream format names (ascii, binary)
compressionType
Compression treatment (UNCOMPRESSED | COMPRESSED)
@ UNCOMPRESSED
compression = false
@ COMPRESSED
compression = true
static const versionNumber currentVersion
The current version number (2.0)
constexpr IOstreamOption(streamFormat fmt, versionNumber ver, compressionType comp=compressionType::UNCOMPRESSED) noexcept
Construct from components (format, version, compression)
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
A token holds an item read from Istream.
A class for handling words, derived from Foam::string.
OBJstream os(runTime.globalPath()/outputName)
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)