Go to the documentation of this file.
63 Ostream&
operator<<(Ostream& os,
const token& tok);
242 operator<<(os, static_cast<const T&>(*
this));
289 inline void setUndefined();
292 void parseError(
const char* expected)
const;
300 static constexpr
const char*
const typeName =
"token";
306 inline constexpr
token() noexcept;
349 inline static
token boolean(
bool on);
391 inline
bool good() const;
397 inline
bool error() const;
400 inline
bool isBool() const;
403 inline
bool isFlag() const;
427 inline
bool isWord() const;
479 inline scalar
number() const;
546 inline void operator=(
const string& str);
555 inline void operator=(compound* compoundPtr);
565 inline bool operator==(
const std::string&
s)
const;
575 inline bool operator!=(
const std::string&
s)
const;
606 Ostream&
operator<<(Ostream& os,
const token::compound& ct);
608 ostream&
operator<<(ostream& os,
const InfoProxy<token>& ip);
611 Ostream&
operator<<(Ostream& os,
const InfoProxy<token>& ip);
616 #define defineCompoundTypeName(Type, Name) \
617 defineTemplateTypeNameAndDebugWithName(token::Compound<Type>, #Type, 0);
619 #define addCompoundToRunTimeSelectionTable(Type, Name) \
620 token::compound::addIstreamConstructorToTable<token::Compound<Type>> \
621 add##Name##IstreamConstructorToTable_;
Subtract or start of negative number.
bool isDoubleScalar() const
Token is DOUBLE_SCALAR.
static token flag(int bitmask)
Create a token with stream flags, no sanity check.
Assignment/equals [isseparator].
bool isFlag() const
Token is FLAG.
flagType
Stream or output control flags (1-byte width)
label labelToken() const
Return label value.
label ListType::const_reference val
double doubleScalar
Floating-point double precision scalar type.
bool isScalar() const
Token is FLOAT_SCALAR or DOUBLE_SCALAR.
Abstract base class for complex tokens.
A class for handling words, derived from Foam::string.
A templated class for holding compound tokens.
A helper class for outputting values to Ostream.
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
bool isNumber() const
Token is LABEL, FLOAT_SCALAR or DOUBLE_SCALAR.
Reference counter for various OpenFOAM components.
const string & stringToken() const
Return const reference to the string contents.
bool isFloatScalar() const
Token is FLOAT_SCALAR.
float floatScalar
Floating-point single precision scalar type.
bool isString() const
Token is STRING, VARIABLE or VERBATIM string.
End string with double quote.
bool boolToken() const
Return boolean token value.
single character punctuation
Istream & operator>>(Istream &, directionInfo &)
A token holds an item read from Istream.
virtual void write(Ostream &os) const =0
const compound & compoundToken() const
Read access for compound token.
bool isSeparator() const
Token is PUNCTUATION and isseparator.
A token error encountered.
bool good() const
True if token is not UNDEFINED or ERROR.
declareRunTimeSelectionTable(autoPtr, compound, Istream,(Istream &is),(is))
Declare run-time constructor selection table.
bool isCompound() const
Token is COMPOUND.
TypeName("compound")
Runtime type information.
punctuationToken pToken() const
Return punctuation character.
static bool isseparator(int c)
True if the character is a punctuation separator (eg, in ISstream).
bool isLabel() const
Token is LABEL.
floatScalar floatScalarToken() const
Return float value.
float (single-precision) type
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
scalar number() const
Return label, float or double value.
InfoProxy< token > info() const
Return info proxy for printing token information to a stream.
Begin dimensions [isseparator].
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
A dictionary $variable (string variant)
bool operator!=(const token &tok) const
void reset()
Reset token to UNDEFINED and clear any allocated storage.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
bool isVariable() const
Token is VARIABLE.
virtual ~compound()=default
Destructor.
friend Ostream & operator<<(Ostream &os, const token &tok)
compound & transferCompoundToken(const Istream &is)
static bool isCompound(const word &name)
Return true if name is a known (registered) compound type.
void write(Ostream &os) const
static const token undefinedToken
An undefined token.
tokenType
Enumeration defining the types of token.
Compound type such as List<label> etc.
bool isWord() const
Token is WORD.
End dimensions [isseparator].
Hash - directive or verbatim string.
bool setType(const tokenType variant)
Change the token type, for similar types.
bool operator==(const token &tok) const
Begin block [isseparator].
const word & wordToken() const
Return const reference to the word contents.
virtual label size() const =0
static constexpr const char *const typeName
The type name is "token".
friend Ostream & operator<<(Ostream &os, const compound &ct)
Output operator.
void swap(token &tok)
Swap token contents: type, data, line-number.
TypeName("Compound<T>")
Runtime type information.
stream flag (1-byte bitmask)
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
tokenType type() const
Return the token type.
bool isBool() const
Token is BOOL.
scalar scalarToken() const
Return float or double value.
word name() const
Return the name of the token type.
Macros to ease declaration of run-time selection tables.
bool isVerbatim() const
Token is VERBATIM string.
double (double-precision) type
compound()
Construct null.
doubleScalar doubleScalarToken() const
Return double value.
const dimensionedScalar c
Speed of light in a vacuum.
constexpr token() noexcept
Construct null, initialized to an UNDEFINED token.
bool undefined() const
Token is UNDEFINED.
int flagToken() const
Return flag bitmask value.
static autoPtr< compound > New(const word &type, Istream &is)
Select null constructed.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
label lineNumber() const
The line number for the token.
The TAB Method for Numerical Calculation of Spray Droplet Breakup.
bool isPunctuation() const
Token is PUNCTUATION.
Begin list [isseparator].
Class to handle errors and exceptions in a simple, consistent stream-based manner.
bool isStringType() const
Token is WORD, STRING, VARIABLE or VERBATIM.
Begin string with double quote.
Ostream & operator<<(Ostream &, const boundaryPatch &)
punctuationToken
Standard punctuation tokens (a character)
void operator=(const token &tok)
Copy assign.
void setBad()
Clear token and set to be ERROR.