44 #ifndef Foam_IOstreamOption_H 45 #define Foam_IOstreamOption_H 58 template<
class EnumType>
class Enum;
133 number_(10*major + (minor % 10))
139 number_(10*ver + 0.001)
155 std::string
str()
const 159 std::to_string(
int(number_ / 10))
161 + std::to_string(
int(number_ % 10))
183 return (number_ - other.number_);
255 const word& compName,
333 version_(opt.version_),
335 compression_(opt.compression_)
394 versionNumber old(version_);
403 versionNumber old(version_);
404 version_ = versionNumber(tok);
424 inline bool operator==
434 inline bool operator!=
444 inline bool operator<
450 return a.compare(
b) < 0;
454 inline bool operator<=
464 inline bool operator>
470 return a.compare(
b) > 0;
474 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...
General relative velocity model.
static const Enum< streamFormat > formatNames
Stream format names (ascii, binary)
floatFormat
Float formats (eg, time directory name formats)
A token holds an item read from Istream.
append (seek end each write)
A simple container for options an IOstream can normally have.
IOstream & fixed(IOstream &io)
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)
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)
no append (truncates existing)
Representation of a major/minor version number.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
append (seek end after open)
OBJstream os(runTime.globalPath()/outputName)
compressionType compression() const noexcept
Get the stream compression.
appendType
File appending (NO_APPEND | APPEND_APP | APPEND_ATE)
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
static floatFormat floatFormatEnum(const word &fmtName, const floatFormat deflt=floatFormat::general)
Lookup floatFormat enum corresponding to the string (general | fixed | scientific).
auto key(const Type &t) -> typename std::enable_if< std::is_enum< Type >::value, typename std::underlying_type< Type >::type >::type
static const Enum< floatFormat > floatFormatNames
Names for float formats (general, fixed, scientific)
constexpr versionNumber() noexcept
Default construct current version. The value (2.0) corresponds to the current version.
static streamFormat formatEnum(const word &fmtName, const streamFormat deflt=streamFormat::ASCII)
Lookup streamFormat enum corresponding to the string (ascii | binary).
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.
IOstream & scientific(IOstream &io)