93 return static_cast<unsigned char>(
x);
121 static switchType asEnum(
const std::string&,
const bool allowInvalid);
154 Switch(
const std::string& str,
const bool allowInvalid=
false)
156 switch_(asEnum(str, allowInvalid))
161 Switch(
const char* str,
const bool allowInvalid=
false)
163 switch_(asEnum(std::
string(str), allowInvalid))
175 const Switch& defaultValue =
false
185 const char*
asText()
const;
194 operator bool()
const
196 return (
toInt(switch_) & 0x1);
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
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.
friend switchType operator++(switchType &x)
Increment the switchType counter.
bool readIfPresent(const word &, const dictionary &)
Update the value of the Switch if it is found in the dictionary.
static const unsigned char nSwitchType
Number of switchTypes.
static Switch lookupOrAddToDict(const word &, dictionary &, const Switch &defaultValue=false)
Construct from dictionary, supplying default value so that if the.
bool valid() const
Return true if the Switch has a valid value.
const char * asText() const
Return a text representation of the Switch.
void operator=(const switchType sw)
Assignment to enumerated value.
static unsigned char toInt(const switchType x)
Convert switchType to integer (unsigned char)
Switch()
Construct null as false.
friend Ostream & operator<<(Ostream &, const Switch &)
friend Istream & operator>>(Istream &, Switch &)
A list of keyword definitions, which are a keyword followed by any number of values (e....
A class for handling character strings derived from std::string.
A class for handling words, derived from string.
Istream & operator>>(Istream &, pistonPointEdgeData &)
Ostream & operator<<(Ostream &os, const fvConstraints &constraints)