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)
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,
370 Ostream&
operator<<(Ostream&
os,
const IOstreamOption::versionNumber& ver);
378 inline bool operator==
388 inline bool operator!=
398 inline bool operator<
404 return a.compare(
b) < 0;
408 inline bool operator<=
418 inline bool operator>
424 return a.compare(
b) > 0;
428 inline bool operator>=
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
int canonical() const noexcept
From version to canonical integer value.
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
auto key(const Type &t) -> typename std::enable_if< std::is_enum< Type >::value, typename std::underlying_type< Type >::type >::type
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.
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 as major.minor.
streamFormat
Data format (ascii | binary)
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
OBJstream os(runTime.globalPath()/outputName)
static versionNumber canonical(int verNum) noexcept
From canonical integer value to version.
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)