31 const char* Foam::Switch::names[nSwitchType] =
53 const std::string& str,
54 const bool allowInvalid
59 if (str == names[
toInt(sw)])
102 <<
"unknown switch word " << str <<
nl
114 return switch_ <= switchType::none;
120 return names[toInt(switch_)];
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
switchType
The various text representations for a switch value.
bool readIfPresent(const word &, const dictionary &)
Update the value of the Switch if it is found in the dictionary.
bool valid() const
Return true if the Switch has a valid value.
const char * asText() const
Return a text representation of the Switch.
static unsigned char toInt(const switchType x)
Convert switchType to integer (unsigned char)
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
bool readIfPresent(const word &, T &, bool recursive=false, bool patternMatch=true) const
Find an entry if present, and assign to T.
A class for handling words, derived from string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
errorManip< error > abort(error &err)
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.