45 os <<
"undefined token";
49 os <<
"bool '" << (tok.
boolToken() ?
"true" :
"false") <<
'\'';
57 os <<
"punctuation '" << tok.
pToken() <<
'\'';
122 os <<
"compound of type "
132 os <<
"unknown token type '" << int(tok.
type()) <<
'\'';
195 return "unknown(" + std::to_string(
int(tokType)) +
")";
215 <<
"Undefined token" <<
endl;
223 os << tok.data_.punctuationVal;
227 os << tok.data_.flagVal;
231 os << tok.data_.int32Val;
235 os << tok.data_.int64Val;
239 os << tok.data_.uint32Val;
243 os << tok.data_.uint64Val;
247 os << tok.data_.floatVal;
251 os << tok.data_.doubleVal;
265 os << *tok.data_.wordPtr;
269 os << *tok.data_.stringPtr;
273 os << *tok.data_.compoundPtr;
279 <<
"Error token" <<
endl;
285 <<
"Unknown token" <<
endl;
295 return os << char(pt);
301 return os << char(pt);
324 const InfoProxy<token>& iproxy
335 const InfoProxy<token>& iproxy
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
bool good() const noexcept
True if next operation might succeed.
A helper class for outputting values to Ostream.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
virtual Istream & read(token &)=0
Return next token from stream.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Abstract base class for complex tokens.
bool moved() const noexcept
Get compound transferred status.
bool pending() const noexcept
Get compound pending-read status.
virtual void write(Ostream &os) const =0
Write the underlying content.
A token holds an item read from Istream.
tokenType
Enumeration defining the types of token.
@ ERROR
Token error encountered.
@ DOUBLE
double (double-precision) type
@ FLAG
stream flag (1-byte bitmask)
@ UNSIGNED_INTEGER_32
uint32 type
@ UNDEFINED
An undefined token-type.
@ COMPOUND
Compound type such as List<label> etc.
@ CHAR_DATA
String-variant: plain character content.
@ FLOAT
float (single-precision) type
@ UNSIGNED_INTEGER_64
uint64 type
@ STRING
Foam::string (usually double-quoted).
@ PUNCTUATION
single character punctuation
label lineNumber() const noexcept
The line number for the token.
word name() const
Return the name of the current token type.
punctuationToken
Standard punctuation tokens (a character).
float floatToken() const
Return float value.
const string & stringToken() const
Return const reference to the string contents.
punctuationToken pToken() const
Return punctuation character.
bool good() const noexcept
True if token is not UNDEFINED or ERROR.
constexpr token() noexcept
Default construct, initialized to an UNDEFINED token.
bool boolToken() const
Return boolean token value.
double doubleToken() const
Return double value.
const compound & compoundToken() const
Const reference to compound token. Fatal if the wrong type.
uint32_t uint32Token() const
Return int32 value, convert from other integer type or Error.
int flagToken() const
Return flag bitmask value.
tokenType type() const noexcept
Return the token type.
int64_t int64Token() const
Return int64 value, convert from other integer type or Error.
void reset()
Reset token to UNDEFINED and clear any allocated storage.
int32_t int32Token() const
Return int32 value, convert from other integer type or Error.
const word & wordToken() const
Return const reference to the word contents.
bool read(Istream &is)
Read a token from Istream, calls reset() first.
uint64_t uint64Token() const
Return int64 value, convert from other integer type or Error.
A class for handling words, derived from Foam::string.
limits reset(1/(limits.max()+VSMALL), 1/(limits.min()+VSMALL))
OBJstream os(runTime.globalPath()/outputName)
#define WarningInFunction
Report a warning using Foam::Warning.
#define SeriousErrorInFunction
Report an error message using Foam::SeriousError.
static OS & printTokenInfo(OS &os, const token &tok)
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces).
Ostream & endl(Ostream &os)
Add newline and flush stream.
Istream & operator>>(Istream &, directionInfo &)