44 { streamFormat::ASCII,
"ascii" },
45 { streamFormat::BINARY,
"binary" },
54 const word& formatName,
60 if (!formatName.empty())
70 <<
"Unknown format specifier '" << formatName
86 return formatNames.getOrDefault(key,
dict, deflt,
true);
99 if (!compName.empty())
108 ? compressionType::COMPRESSED
109 : compressionType::UNCOMPRESSED
116 <<
"Unknown compression specifier '" << compName
117 <<
"', using compression "
118 << (deflt ?
"on" :
"off" ) <<
nl;
136 ? compressionType::COMPRESSED
137 : compressionType::UNCOMPRESSED
167 <<
"Wrong token for version - expected word/number, found "
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
bool found(const word &enumName) const
True if there is an enumeration corresponding to the given name.
Representation of a major/minor version number.
constexpr versionNumber() noexcept
static compressionType compressionEnum(const word &compName, const compressionType deflt=compressionType::UNCOMPRESSED)
The compression enum corresponding to the string.
streamFormat
Data format (ascii | binary)
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)
static const versionNumber currentVersion
The current version number (2.0)
virtual Ostream & writeQuoted(const std::string &str, const bool quoted=true)
Write std::string surrounded by quotes.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
bool good() const noexcept
True if the Switch represents a valid enumeration.
static Switch find(const std::string &str)
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
bool readIfPresent(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX) const
A token holds an item read from Istream.
bool isNumber() const noexcept
Token is LABEL, FLOAT or DOUBLE.
const string & stringToken() const
Return const reference to the string contents.
InfoProxy< token > info() const
Return info proxy for printing token information to a stream.
bool isStringType() const noexcept
scalar number() const
Return label, float or double value.
A class for handling words, derived from Foam::string.
OBJstream os(runTime.globalPath()/outputName)
#define WarningInFunction
Report a warning using Foam::Warning.
constexpr char nl
The newline '\n' character (0x0a)