Go to the documentation of this file.
44 { streamFormat::ASCII,
"ascii" },
45 { streamFormat::BINARY,
"binary" },
54 const word& formatName,
60 if (!formatName.empty())
62 if (formatNames.found(formatName))
64 return formatNames[formatName];
70 <<
"Unknown format specifier '" << formatName
71 <<
"', using '" << formatNames[deflt] <<
"'\n";
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 "
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
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.
bool isNumber() const
Token is LABEL, FLOAT or DOUBLE.
const string & stringToken() const
Return const reference to the string contents.
virtual Ostream & writeQuoted(const std::string &str, const bool quoted=true)=0
Write std::string surrounded by quotes.
static const versionNumber currentVersion
The current version number (2.0)
A token holds an item read from Istream.
bool good() const noexcept
True if the Switch represents a valid enumeration.
scalar number() const
Return label, float or double value.
Representation of a major/minor version number.
InfoProxy< token > info() const
Return info proxy for printing token information to a stream.
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)
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
label find(const ListType &input, const UnaryPredicate &pred, const label start=0)
Find index of the first occurrence that satisfies the predicate.
static streamFormat formatEnum(const word &formatName, const streamFormat deflt=streamFormat::ASCII)
compressionType
Compression treatment (UNCOMPRESSED | COMPRESSED)
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
#define WarningInFunction
Report a warning using Foam::Warning.
static const Enum< streamFormat > formatNames
Stream format names (ascii, binary)
bool isStringType() const
Token is WORD, DIRECTIVE, STRING, VARIABLE or VERBATIM.