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 const Switch& defaultValue
131 return names[
toInt(switch_)];
bool valid() const
Return true if the Switch has a valid value.
switchType
The various text representations for a switch value.
A list of keyword definitions, which are a keyword followed by any number of values (e...
bool readIfPresent(const word &, const dictionary &)
Update the value of the Switch if it is found in the dictionary.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
T lookupOrAddDefault(const word &, const T &, bool recursive=false, bool patternMatch=true)
Find and return a T, if not found return the given.
static unsigned char toInt(const switchType x)
Convert switchType to integer (unsigned char)
A simple wrapper around bool so that it can be read as a word: true/false, on/off, yes/no, y/n, t/f, or none/any.
static Switch lookupOrAddToDict(const word &, dictionary &, const Switch &defaultValue=false)
Construct from dictionary, supplying default value so that if the.
A class for handling words, derived from string.
bool readIfPresent(const word &, T &, bool recursive=false, bool patternMatch=true) const
Find an entry if present, and assign to T.
errorManip< error > abort(error &err)
const char * asText() const
Return a text representation of the Switch.
word name(const complex &)
Return a string representation of a complex.