Go to the documentation of this file.
50 const std::string& str,
51 const bool allowInvalid
98 <<
"unknown switch word " << str <<
nl
110 const Switch& defaultValue
127 return names[switch_];
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
static switchType asEnum(const std::string &, const bool allowInvalid)
Return a switchType representation of a word.
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.
bool valid() const
Return true if the Switch has a valid value.
A list of keyword definitions, which are a keyword followed by any number of values (e....
static const char * names[INVALID+1]
The set of names corresponding to the switchType enumeration.
const char * asText() const
Return a text representation of the Switch.
errorManip< error > abort(error &err)
bool readIfPresent(const word &, const dictionary &)
Update the value of the Switch if it is found in the dictionary.
switchType
The various text representations for a switch value.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
unsigned char switch_
The logic and enumerated text representation stored as a single byte.
word name(const complex &)
Return a string representation of a complex.
static Switch lookupOrAddToDict(const word &, dictionary &, const Switch &defaultValue=false)
Construct from dictionary, supplying default value so that if the.