47 #ifndef Foam_IOstreamOption_H 48 #define Foam_IOstreamOption_H 60 template<
class EnumType>
class Enum;
121 number_(10*major + (minor % 10))
127 number_(10*ver + 0.001)
143 std::string
str()
const 147 std::to_string(
int(number_ / 10))
149 + std::to_string(
int(number_ % 10))
171 return number_ - other.number_;
249 version_(opt.version_),
251 compression_(opt.compression_)
266 const word& formatName,
287 const word& compName,
355 versionNumber old(version_);
385 inline bool operator==
395 inline bool operator!=
405 inline bool operator<
411 return a.compare(
b) < 0;
415 inline bool operator<=
425 inline bool operator>
431 return a.compare(
b) > 0;
435 inline bool operator>=
int compare(const versionNumber &other) const noexcept
Compare differences in the versions.
compressionType
Compression treatment (UNCOMPRESSED | COMPRESSED)
A list of keyword definitions, which are a keyword followed by a number of values (eg...
static const Enum< streamFormat > formatNames
Stream format names (ascii, binary)
A token holds an item read from Istream.
A simple container for options an IOstream can normally have.
constexpr IOstreamOption(streamFormat fmt=streamFormat::ASCII, compressionType comp=compressionType::UNCOMPRESSED) noexcept
Default construct (ASCII, UNCOMPRESSED, currentVersion) or construct with format, compression...
int canonical() const noexcept
From version to canonical integer value.
atomicType
Atomic operations (output)
static streamFormat formatEnum(const word &formatName, const streamFormat deflt=streamFormat::ASCII)
The stream format enum corresponding to the string (ascii | binary).
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
A class for handling words, derived from Foam::string.
static const versionNumber currentVersion
The current version number (2.0)
Representation of a major/minor version number.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
OBJstream os(runTime.globalPath()/outputName)
compressionType compression() const noexcept
Get the stream compression.
appendType
File appending (NON_APPEND | APPEND)
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
auto key(const Type &t) -> typename std::enable_if< std::is_enum< Type >::value, typename std::underlying_type< Type >::type >::type
constexpr versionNumber() noexcept
Default construct current version. The value (2.0) corresponds to the current version.
versionNumber version() const noexcept
Get the stream version.
streamFormat
Data format (ascii | binary)
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 format() const noexcept
Get the current stream format.