66 unsigned char switch_;
112 static switchType asEnum(
const std::string&,
const bool allowInvalid);
145 Switch(
const std::string& str,
const bool allowInvalid=
false)
147 switch_(asEnum(str, allowInvalid))
152 Switch(
const char* str,
const bool allowInvalid=
false)
154 switch_(asEnum(
std::
string(str), allowInvalid))
166 const Switch& defaultValue =
false 176 const char*
asText()
const;
185 operator bool()
const 187 return (switch_ & 0x1);
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...
bool readIfPresent(const word &, const dictionary &)
Update the value of the Switch if it is found in the dictionary.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
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.
static const char * names[INVALID+1]
The set of names corresponding to the switchType enumeration.
static Switch lookupOrAddToDict(const word &, dictionary &, const Switch &defaultValue=false)
Construct from dictionary, supplying default value so that if the.
friend Ostream & operator<<(Ostream &, const Switch &)
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
A class for handling words, derived from string.
Istream & operator>>(Istream &, directionInfo &)
friend Istream & operator>>(Istream &, Switch &)
An Ostream is an abstract base class for all output systems (streams, files, token lists...
const char * asText() const
Return a text representation of the Switch.
Switch()
Construct null as false.
void operator=(const switchType sw)
Assignment to enumerated value.
Ostream & operator<<(Ostream &, const ensightPart &)
switchType
The various text representations for a switch value.
A class for handling character strings derived from std::string.