Go to the documentation of this file.
45 #ifndef IOstreamOption_H
46 #define IOstreamOption_H
58 template<
class EnumType>
class Enum;
111 number_(10*ver + 0.001)
131 return number_ - other.number_;
143 return int(number_ / 10);
149 return int(number_ % 10);
153 std::string
str()
const
236 version_(opt.version_),
238 compression_(opt.compression_)
253 const word& formatName,
274 const word& compName,
371 Ostream&
operator<<(Ostream& os,
const IOstreamOption::versionNumber& ver);
377 inline bool operator==
387 inline bool operator!=
397 inline bool operator<
403 return a.compare(
b) < 0;
407 inline bool operator<=
417 inline bool operator>
423 return a.compare(
b) > 0;
427 inline bool operator>=
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
A class for handling words, derived from Foam::string.
int compare(const versionNumber &other) const noexcept
Compare differences in the versions.
constexpr IOstreamOption(streamFormat fmt=streamFormat::ASCII, compressionType comp=compressionType::UNCOMPRESSED) noexcept
int canonical() noexcept
The canonical major/minor pair as an integer value.
streamFormat format() const noexcept
Get the current stream format.
static const versionNumber currentVersion
The current version number (2.0)
A token holds an item read from Istream.
constexpr versionNumber(int major, int minor) noexcept
Construct from major, number.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
Representation of a major/minor version number.
int getMajor() const noexcept
Return the major version number.
The IOstreamOption is a simple container for options an IOstream can normally have.
versionNumber version() const noexcept
Get the stream version.
constexpr versionNumber() noexcept
static compressionType compressionEnum(const word &compName, const compressionType deflt=compressionType::UNCOMPRESSED)
The compression enum corresponding to the string.
std::string str() const
A string representation of major.minor.
streamFormat
Data format (ascii | binary)
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
int getMinor() const noexcept
Return the minor version number.
static streamFormat formatEnum(const word &formatName, const streamFormat deflt=streamFormat::ASCII)
IOstreamOption(const IOstreamOption &opt, streamFormat fmt) noexcept
Copy construct with change of format.
compressionType
Compression treatment (UNCOMPRESSED | COMPRESSED)
compressionType compression() const noexcept
Get the stream compression.
constexpr versionNumber(const float ver) noexcept
Construct from floating-point version number.
static const Enum< streamFormat > formatNames
Stream format names (ascii, binary)