46 os <<
"undefined token";
50 os <<
"bool '" << (tok.
boolToken() ?
"true" :
"false") <<
'\'';
58 os <<
"punctuation '" << tok.
pToken() <<
'\'';
103 os <<
"compound of type "
113 os <<
"unknown token type '" << int(tok.
type()) <<
'\'';
158 return "unknown(" + std::to_string(
int(type_)) +
")";
178 <<
"Undefined token" <<
endl;
186 os << tok.data_.punctuationVal;
191 os << tok.data_.labelVal;
195 os << tok.data_.floatVal;
199 os << tok.data_.doubleVal;
212 os << *tok.data_.wordPtr;
216 os << *tok.data_.stringPtr;
220 os << *tok.data_.compoundPtr;
226 <<
"Error token" <<
endl;
232 <<
"Unknown token" <<
endl;
242 return os << char(pt);
248 return os << char(pt);
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
virtual bool check(const char *operation) const
Check IOstream status for given operation.
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.
virtual Ostream & write(const char c)
Write character.
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.
virtual void write(Ostream &os) const =0
Redirect write to underlying content.
A token holds an item read from Istream.
floatScalar floatToken() const
Return float value.
@ LABEL
label (integer) type
@ ERROR
Token error encountered.
@ DOUBLE
double (double-precision) type
@ FLAG
stream flag (1-byte bitmask)
@ UNDEFINED
An undefined token-type.
@ COMPOUND
Compound type such as List<label> etc.
@ FLOAT
float (single-precision) 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 token type.
punctuationToken
Standard punctuation tokens (a character)
const string & stringToken() const
Return const reference to the string contents.
punctuationToken pToken() const
Return punctuation character.
label labelToken() const
Return label value.
constexpr token() noexcept
Default construct, initialized to an UNDEFINED token.
bool boolToken() const
Return boolean token value.
const compound & compoundToken() const
Read access for compound token.
int flagToken() const
Return flag bitmask value.
doubleScalar doubleToken() const
Return double value.
tokenType type() const noexcept
Return the token type.
void reset()
Reset token to UNDEFINED and clear any allocated storage.
const word & wordToken() const
Return const reference to the word contents.
A class for handling words, derived from Foam::string.
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 &)