Loading...
Searching...
No Matches
token Class Reference

A token holds an item read from Istream. More...

#include <token.H>

Collaboration diagram for token:

Classes

class  compound
 Abstract base class for complex tokens. More...
class  Compound
 A templated class for holding compound tokens. The underlying container is normally a List of values, it must have a value_type typedef as well as size(), resize(), cdata_bytes(), data_bytes(), size_bytes() methods. More...

Public Types

enum  tokenType : char {
  UNDEFINED = '\0' , ERROR = '\x80' , FLAG , PUNCTUATION ,
  BOOL , INTEGER_32 , INTEGER_64 , UNSIGNED_INTEGER_32 ,
  UNSIGNED_INTEGER_64 , FLOAT , DOUBLE , WORD ,
  STRING , COMPOUND , DIRECTIVE , EXPRESSION ,
  VARIABLE , VERBATIM , CHAR_DATA , FLOAT_SCALAR = FLOAT ,
  DOUBLE_SCALAR = DOUBLE , VERBATIMSTRING = VERBATIM , LABEL = INTEGER_32
}
 Enumeration defining the types of token. More...
enum  flagType { NO_FLAG = 0 , ASCII = 1 , BINARY = 2 }
 Stream or output control flags (1-byte width). More...
enum  punctuationToken : char {
  NULL_TOKEN = '\0' , TAB = '\t' , NL = '\n' , SPACE = ' ' ,
  COLON = ':' , SEMICOLON = ';' , COMMA = ',' , HASH = '#' ,
  DOLLAR = '$' , QUESTION = '?' , ATSYM = '@' , SQUOTE = '\'' ,
  DQUOTE = '"' , ASSIGN = '=' , PLUS = '+' , MINUS = '-' ,
  MULTIPLY = '*' , DIVIDE = '/' , LPAREN = '(' , RPAREN = ')' ,
  LSQUARE = '[' , RSQUARE = ']' , LBRACE = '{' , RBRACE = '}' ,
  ADD = PLUS , SUBTRACT = MINUS , END_STATEMENT = SEMICOLON , BEGIN_LIST = LPAREN ,
  END_LIST = RPAREN , BEGIN_SQR = LSQUARE , END_SQR = RSQUARE , BEGIN_BLOCK = LBRACE ,
  END_BLOCK = RBRACE , BEGIN_STRING = DQUOTE , END_STRING = DQUOTE
}
 Standard punctuation tokens (a character). More...

Public Member Functions

constexpr token () noexcept
 Default construct, initialized to an UNDEFINED token.
 token (const token &t)
 Copy construct.
 token (token &&t) noexcept
 Move construct. The original token is left as UNDEFINED.
 token (punctuationToken p, label lineNum=0) noexcept
 Construct punctuation character token.
 token (int32_t val, label lineNum=0) noexcept
 Construct 32-bit integer token.
 token (int64_t val, label lineNum=0) noexcept
 Construct 64-bit integer token.
 token (uint32_t val, label lineNum=0) noexcept
 Construct unsigned 32-bit integer token.
 token (uint64_t val, label lineNum=0) noexcept
 Construct unsigned 64-bit integer token.
 token (float val, label lineNum=0) noexcept
 Construct float token.
 token (double val, label lineNum=0) noexcept
 Construct double token.
 token (const word &w, label lineNum=0)
 Copy construct word token.
 token (const string &str, label lineNum=0)
 Copy construct string token.
 token (word &&w, label lineNum=0)
 Move construct word token.
 token (string &&str, label lineNum=0)
 Move construct string token.
 token (tokenType typ, const std::string &, label line=0)
 Copy construct word/string token with the specified variant.
 token (tokenType typ, std::string &&, label line=0)
 Move construct word/string token with the specified variant.
 token (token::compound *ptr, label lineNum=0)
 Construct from a compound pointer, taking ownership.
 token (autoPtr< token::compound > &&ptr, label lineNum=0)
 Move construct from a compound pointer, taking ownership.
 token (Istream &is)
 Construct from Istream.
 ~token ()
 Destructor.
word name () const
 Return the name of the current token type.
tokenType type () const noexcept
 Return the token type.
bool setType (const tokenType tokType) noexcept
 Change the token type, for similar types.
label lineNumber () const noexcept
 The line number for the token.
label lineNumber (const label lineNum) noexcept
 Change token line number, return old value.
bool good () const noexcept
 True if token is not UNDEFINED or ERROR.
bool undefined () const noexcept
 Token is UNDEFINED.
bool error () const noexcept
 Token is ERROR.
bool isBool () const noexcept
 Token is BOOL.
bool isFlag () const noexcept
 Token is FLAG.
bool isPunctuation () const noexcept
 Token is PUNCTUATION.
bool isPunctuation (punctuationToken p) const noexcept
 True if token is PUNCTUATION and equal to parameter.
bool isSeparator () const noexcept
 Token is PUNCTUATION and isseparator.
bool isIntType () const noexcept
 Token is (int32 | int64 | uint32 | uint64).
bool is_int32 () const noexcept
 Token is INTEGER_32 or is convertible to one.
bool is_int64 () const noexcept
 Token is INTEGER_64 or is convertible to one.
bool is_uint32 () const noexcept
 Token is UNSIGNED_INTEGER_32 or is convertible to one.
bool is_uint64 () const noexcept
 Token is UNSIGNED_INTEGER_64 or is convertible to one.
bool isLabel () const noexcept
 Integral token is convertible to Foam::label.
bool isULabel () const noexcept
 Integral token is convertible to Foam::uLabel.
bool isLabel (const label value) const noexcept
 True if token is integer type and equal to parameter.
bool isFloat () const noexcept
 Token is FLOAT.
bool isDouble () const noexcept
 Token is DOUBLE.
bool isScalar () const noexcept
 Token is FLOAT or DOUBLE.
bool isNumber () const noexcept
 Token is (signed/unsigned) integer type, FLOAT or DOUBLE.
bool isWord () const noexcept
 Token is word-variant (WORD, DIRECTIVE).
bool isWord (const std::string &s) const
 Token is word-variant and equal to parameter.
bool isDirective () const noexcept
 Token is DIRECTIVE (word variant).
bool isQuotedString () const noexcept
 Token is (quoted) STRING (string variant).
bool isString () const noexcept
 Token is string-variant (STRING, EXPRESSION, VARIABLE, VERBATIM, CHAR_DATA).
bool isExpression () const noexcept
 Token is EXPRESSION (string variant).
bool isVariable () const noexcept
 Token is VARIABLE (string variant).
bool isVerbatim () const noexcept
 Token is VERBATIM string (string variant).
bool isCharData () const noexcept
 Token is CHAR_DATA (string variant).
bool isStringType () const noexcept
 Token is word-variant or string-variant (WORD, DIRECTIVE, STRING, EXPRESSION, VARIABLE, VERBATIM, CHAR_DATA).
bool isCompound () const noexcept
 Token is COMPOUND.
bool isCompound (const word &compoundType) const
 True if token is COMPOUND and its type() is equal to parameter.
template<class Type>
const Type * isCompound () const
 If token is COMPOUND and can be dynamic_cast to the Type return a const pointer to the content.
 operator bool () const noexcept
 True if token is not UNDEFINED or ERROR. Same as good().
bool boolToken () const
 Return boolean token value.
void boolToken (bool on)
 Assign to a boolean token.
int flagToken () const
 Return flag bitmask value.
punctuationToken pToken () const
 Return punctuation character.
void pToken (punctuationToken p)
 Assign to a punctuation token.
int32_t int32Token () const
 Return int32 value, convert from other integer type or Error.
void int32Token (int32_t val)
 Assign a int32 value token.
int64_t int64Token () const
 Return int64 value, convert from other integer type or Error.
void int64Token (int64_t val)
 Assign a int64 value token.
uint32_t uint32Token () const
 Return int32 value, convert from other integer type or Error.
void uint32Token (uint32_t val)
 Assign a uint32 value token.
uint64_t uint64Token () const
 Return int64 value, convert from other integer type or Error.
void uint64Token (uint64_t val)
 Assign a uint64 value token.
label labelToken () const
 Return integer type as label value or Error.
uLabel uLabelToken () const
 Return integer type as uLabel value or Error.
void labelToken (const label val)
 Assign to a label (int32 or int64) token.
float floatToken () const
 Return float value.
void floatToken (const float val)
 Assign to a float token.
double doubleToken () const
 Return double value.
void doubleToken (const double val)
 Assign to a double token.
scalar scalarToken () const
 Return float or double value.
scalar number () const
 Return label, float or double value.
const wordwordToken () const
 Return const reference to the word contents.
const stringstringToken () const
 Return const reference to the string contents.
const compoundcompoundToken () const
 Const reference to compound token. Fatal if the wrong type.
compoundrefCompoundToken ()
 Return reference to compound token. Fatal if the wrong type. No checks for released or pending states.
template<class Type>
Type & refCompoundToken ()
 Return reference to the underlying encapsulated container (eg, List<label> etc) of a compound token. No checks for released or pending states.
bool readCompoundToken (const word &compoundType, Istream &is, const bool readContent=true)
 Default construct the specified compound type and read from stream.
compoundtransferCompoundToken (const Istream *is=nullptr)
 Return reference to compound and mark internally as released.
compoundtransferCompoundToken (const Istream &is)
 Return reference to compound and mark internally as released.
template<class Type>
Type & transferCompoundToken (const Istream &is)
 Mark the compound as released and return a reference to the underlying encapsulated container - eg, List<label>.
void reset ()
 Reset token to UNDEFINED and clear any allocated storage.
void setBad ()
 Clear token and set to be ERROR.
void swap (token &tok) noexcept
 Swap token contents: type, data, line-number.
bool read (Istream &is)
 Read a token from Istream, calls reset() first.
InfoProxy< tokeninfo () const noexcept
 Return info proxy, for printing token information to a stream.
void operator= (const token &tok)
 Copy assign.
void operator= (token &&tok)
 Move assign.
void operator= (const punctuationToken p)
 Copy assign from punctuation.
void operator= (int32_t val)
 Copy assign from int32_t.
void operator= (int64_t val)
 Copy assign from int64_t.
void operator= (uint32_t val)
 Copy assign from uint32_t.
void operator= (uint64_t val)
 Copy assign from uint64_t.
void operator= (float val)
 Copy assign from float.
void operator= (double val)
 Copy assign from double.
void operator= (const word &w)
 Copy assign from word content.
void operator= (const string &str)
 Copy assign from string content.
void operator= (word &&w)
 Move assign from word content.
void operator= (string &&str)
 Move assign from string content.
void operator= (token::compound *ptr)
 Assign compound with reference counting to token.
void operator= (autoPtr< token::compound > &&ptr)
 Move assign from compound pointer.
bool operator== (const token &tok) const
bool operator== (const punctuationToken p) const noexcept
bool operator== (const int32_t val) const noexcept
bool operator== (const int64_t val) const noexcept
bool operator== (const uint32_t val) const noexcept
bool operator== (const uint64_t val) const noexcept
bool operator== (const float val) const noexcept
bool operator== (const double val) const noexcept
bool operator== (const std::string &) const
bool operator!= (const token &t) const
bool operator!= (punctuationToken p) const noexcept
bool operator!= (int32_t b) const noexcept
bool operator!= (int64_t b) const noexcept
bool operator!= (uint32_t b) const noexcept
bool operator!= (uint64_t b) const noexcept
bool operator!= (float b) const noexcept
bool operator!= (double b) const noexcept
bool operator!= (const std::string &s) const
label & lineNumber () noexcept
 Write access for the token line number.
bool isFloatScalar () const noexcept
 Token is FLOAT.
bool isDoubleScalar () const noexcept
 Token is DOUBLE.
float floatScalarToken () const
 Return float value.
double doubleScalarToken () const
 Return double value.
void operator= (word *)=delete
 Deprecated(2017-11) transfer word pointer to the token.
void operator= (string *)=delete
 Deprecated(2017-11) transfer string pointer to the token.

Static Public Member Functions

static token boolean (bool on) noexcept
 Create a bool token.
static token flag (int bitmask) noexcept
 Create a token with stream flags, no sanity check.
static bool isseparator (int c) noexcept
 True if the character is a punctuation separator (eg, in ISstream).
static word name (const token::tokenType tokType)
 Return the name for the token type.

Static Public Attributes

static const token undefinedToken
 An undefined token.
static constexpr const char *const typeName = "token"
 The type name is "token".

Friends

Ostreamoperator<< (Ostream &os, const token &tok)
Ostreamoperator<< (Ostream &os, const punctuationToken &pt)
ostreamoperator<< (ostream &os, const punctuationToken &pt)
ostreamoperator<< (ostream &os, const InfoProxy< token > &ip)

Detailed Description

A token holds an item read from Istream.

Note
Use boolean() static method for creating a bool token since bool and int are otherwise indistinguishable
Source files

Definition at line 69 of file token.H.

Member Enumeration Documentation

◆ tokenType

enum tokenType : char

Enumeration defining the types of token.

Since the enumeration is used to tag content in Pstream, it is of type char and shall have values that do not overlap with regular punctuation characters.

Enumerator
UNDEFINED 

An undefined token-type.

ERROR 

Token error encountered.

FLAG 

stream flag (1-byte bitmask)

PUNCTUATION 

single character punctuation

BOOL 

boolean type

INTEGER_32 

int32 type

INTEGER_64 

int64 type

UNSIGNED_INTEGER_32 

uint32 type

UNSIGNED_INTEGER_64 

uint64 type

FLOAT 

float (single-precision) type

DOUBLE 

double (double-precision) type

WORD 

Foam::word.

STRING 

Foam::string (usually double-quoted).

COMPOUND 

Compound type such as List<label> etc.

DIRECTIVE 

Word-variant: dictionary #directive stored with sigil

EXPRESSION 

String-variant: math expression for evaluation stored with delimiters

VARIABLE 

String-variant: dictionary $variable stored with sigil

VERBATIM 

String-variant: verbatim string content stored without delimiters

CHAR_DATA 

String-variant: plain character content.

FLOAT_SCALAR 

compatibility name for FLOAT

DOUBLE_SCALAR 

compatibility name for DOUBLE

VERBATIMSTRING 

compatibility name for VERBATIM

LABEL 

compatibility name

Definition at line 80 of file token.H.

◆ flagType

enum flagType

Stream or output control flags (1-byte width).

Enumerator
NO_FLAG 

No flags.

ASCII 

ASCII-mode stream.

BINARY 

BINARY-mode stream.

Definition at line 128 of file token.H.

◆ punctuationToken

enum punctuationToken : char

Standard punctuation tokens (a character).

Enumerator
NULL_TOKEN 

Nul character.

TAB 

Tab [isspace].

NL 

Newline [isspace].

SPACE 

Space [isspace].

COLON 

Colon [isseparator].

SEMICOLON 

Semicolon [isseparator].

COMMA 

Comma [isseparator].

HASH 

Hash - directive or start verbatim string.

DOLLAR 

Dollar - start variable or expression.

QUESTION 

Question mark (eg, ternary).

ATSYM 

The 'at' symbol.

SQUOTE 

Single quote.

DQUOTE 

Double quote.

ASSIGN 

Assignment/equals [isseparator].

PLUS 

Addition [isseparator].

MINUS 

Subtract or start of negative number.

MULTIPLY 

Multiply [isseparator].

DIVIDE 

Divide [isseparator].

LPAREN 

Left parenthesis [isseparator].

RPAREN 

Right parenthesis [isseparator].

LSQUARE 

Left square bracket [isseparator].

RSQUARE 

Right square bracket [isseparator].

LBRACE 

Left brace [isseparator].

RBRACE 

Right brace [isseparator].

ADD 

Addition [isseparator].

SUBTRACT 

Subtract or start of negative number.

END_STATEMENT 

End entry [isseparator].

BEGIN_LIST 

Begin list [isseparator].

END_LIST 

End list [isseparator].

BEGIN_SQR 

Begin dimensions [isseparator].

END_SQR 

End dimensions [isseparator].

BEGIN_BLOCK 

Begin block [isseparator].

END_BLOCK 

End block [isseparator].

BEGIN_STRING 

Begin string with double quote.

END_STRING 

End string with double quote.

Definition at line 139 of file token.H.

Constructor & Destructor Documentation

◆ token() [1/19]

token ( )
inlineconstexprnoexcept

Default construct, initialized to an UNDEFINED token.

Definition at line 160 of file tokenI.H.

References Foam::noexcept, and UNDEFINED.

Referenced by boolean(), flag(), operator!=(), operator<<, operator=(), operator=(), operator==(), swap(), token(), token(), token(), and token().

Here is the caller graph for this function:

◆ token() [2/19]

token ( const token & t)
inline

Copy construct.

Definition at line 168 of file tokenI.H.

References CHAR_DATA, COMPOUND, DIRECTIVE, EXPRESSION, STRING, token(), VARIABLE, VERBATIM, and WORD.

Here is the call graph for this function:

◆ token() [3/19]

token ( token && t)
inlinenoexcept

Move construct. The original token is left as UNDEFINED.

Definition at line 212 of file tokenI.H.

References Foam::noexcept, and token().

Here is the call graph for this function:

◆ token() [4/19]

token ( punctuationToken p,
label lineNum = 0 )
inlineexplicitnoexcept

Construct punctuation character token.

Definition at line 223 of file tokenI.H.

References Foam::noexcept, p, and PUNCTUATION.

◆ token() [5/19]

token ( int32_t val,
label lineNum = 0 )
inlineexplicitnoexcept

Construct 32-bit integer token.

Definition at line 233 of file tokenI.H.

References INTEGER_32, and Foam::noexcept.

◆ token() [6/19]

token ( int64_t val,
label lineNum = 0 )
inlineexplicitnoexcept

Construct 64-bit integer token.

Definition at line 243 of file tokenI.H.

References INTEGER_64, and Foam::noexcept.

◆ token() [7/19]

token ( uint32_t val,
label lineNum = 0 )
inlineexplicitnoexcept

Construct unsigned 32-bit integer token.

Definition at line 253 of file tokenI.H.

References Foam::noexcept, and UNSIGNED_INTEGER_32.

◆ token() [8/19]

token ( uint64_t val,
label lineNum = 0 )
inlineexplicitnoexcept

Construct unsigned 64-bit integer token.

Definition at line 263 of file tokenI.H.

References Foam::noexcept, and UNSIGNED_INTEGER_64.

◆ token() [9/19]

token ( float val,
label lineNum = 0 )
inlineexplicitnoexcept

Construct float token.

Definition at line 273 of file tokenI.H.

References FLOAT, and Foam::noexcept.

◆ token() [10/19]

token ( double val,
label lineNum = 0 )
inlineexplicitnoexcept

Construct double token.

Definition at line 283 of file tokenI.H.

References DOUBLE, and Foam::noexcept.

◆ token() [11/19]

token ( const word & w,
label lineNum = 0 )
inlineexplicit

Copy construct word token.

Definition at line 293 of file tokenI.H.

References WORD.

◆ token() [12/19]

token ( const string & str,
label lineNum = 0 )
inlineexplicit

Copy construct string token.

Definition at line 303 of file tokenI.H.

References STRING.

◆ token() [13/19]

token ( word && w,
label lineNum = 0 )
inlineexplicit

Move construct word token.

Definition at line 313 of file tokenI.H.

References WORD.

◆ token() [14/19]

token ( string && str,
label lineNum = 0 )
inlineexplicit

Move construct string token.

Definition at line 323 of file tokenI.H.

References STRING.

◆ token() [15/19]

token ( tokenType typ,
const std::string & str,
label line = 0 )
inlineexplicit

Copy construct word/string token with the specified variant.

A invalid word/string variant type is silently treated as STRING. No character stripping

Definition at line 333 of file tokenI.H.

References STRING.

◆ token() [16/19]

token ( tokenType typ,
std::string && str,
label line = 0 )
inlineexplicit

Move construct word/string token with the specified variant.

A invalid word/string variant type is silently treated as STRING. No character stripping

Definition at line 357 of file tokenI.H.

References STRING.

◆ token() [17/19]

token ( token::compound * ptr,
label lineNum = 0 )
inlineexplicit

Construct from a compound pointer, taking ownership.

Definition at line 381 of file tokenI.H.

References COMPOUND.

◆ token() [18/19]

token ( autoPtr< token::compound > && ptr,
label lineNum = 0 )
inlineexplicit

Move construct from a compound pointer, taking ownership.

Definition at line 396 of file tokenI.H.

References token().

Here is the call graph for this function:

◆ token() [19/19]

token ( Istream & is)
explicit

Construct from Istream.

Definition at line 136 of file tokenIO.C.

References Istream::read(), and token().

Here is the call graph for this function:

◆ ~token()

~token ( )
inline

Destructor.

Definition at line 404 of file tokenI.H.

References reset().

Here is the call graph for this function:

Member Function Documentation

◆ boolean()

Foam::token boolean ( bool on)
inlinestaticnoexcept

Create a bool token.

Definition at line 26 of file tokenI.H.

References BOOL, and token().

Here is the call graph for this function:

◆ flag()

Foam::token flag ( int bitmask)
inlinestaticnoexcept

Create a token with stream flags, no sanity check.

Parameters
bitmaskthe flags to set

Definition at line 36 of file tokenI.H.

References FLAG, and token().

Here is the call graph for this function:

◆ isseparator()

bool isseparator ( int c)
inlinestaticnoexcept

True if the character is a punctuation separator (eg, in ISstream).

Since it could also start a number, SUBTRACT is not included as a separator.

Parameters
cthe character to test, passed as int for consistency with isdigit, isspace etc.

Definition at line 81 of file tokenI.H.

References ASSIGN, BEGIN_BLOCK, BEGIN_LIST, BEGIN_SQR, COLON, COMMA, DIVIDE, END_BLOCK, END_LIST, END_SQR, END_STATEMENT, MULTIPLY, and PLUS.

Referenced by isSeparator().

Here is the caller graph for this function:

◆ name() [1/2]

Foam::word name ( const token::tokenType tokType)
static

Return the name for the token type.

Definition at line 159 of file tokenIO.C.

References BOOL, CHAR_DATA, COMPOUND, DIRECTIVE, DOUBLE, ERROR, EXPRESSION, FLAG, FLOAT, INTEGER_32, INTEGER_64, PUNCTUATION, STRING, UNDEFINED, UNSIGNED_INTEGER_32, UNSIGNED_INTEGER_64, VARIABLE, VERBATIM, and WORD.

◆ name() [2/2]

Foam::word name ( ) const
inline

Return the name of the current token type.

Definition at line 476 of file tokenI.H.

References name().

Referenced by name().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ type()

Foam::token::tokenType type ( ) const
inlinenoexcept

Return the token type.

Definition at line 482 of file tokenI.H.

References Foam::noexcept.

Referenced by Foam::printTokenInfo(), OSstream::write(), and UOPstream::write().

Here is the caller graph for this function:

◆ setType()

bool setType ( const tokenType tokType)
inlinenoexcept

Change the token type, for similar types.

This can be used to change between string-like variants (eg, STRING, VARIABLE, etc) To change types entirely (eg, STRING to DOUBLE), use the corresponding assignment operator.

Returns
true if the change was successful or no change was required

Definition at line 488 of file tokenI.H.

References BOOL, CHAR_DATA, DIRECTIVE, EXPRESSION, FLAG, STRING, VARIABLE, VERBATIM, and WORD.

Referenced by ISstream::read(), UIPstreamBase::read(), and exprString::writeEntry().

Here is the caller graph for this function:

◆ lineNumber() [1/3]

Foam::label lineNumber ( ) const
inlinenoexcept

The line number for the token.

Definition at line 570 of file tokenI.H.

References Foam::noexcept.

Referenced by Foam::printTokenInfo(), ISstream::read(), ITstream::read(), and UIPstreamBase::read().

Here is the caller graph for this function:

◆ lineNumber() [2/3]

Foam::label lineNumber ( const label lineNum)
inlinenoexcept

Change token line number, return old value.

Definition at line 576 of file tokenI.H.

◆ good()

◆ undefined()

bool undefined ( ) const
inlinenoexcept

Token is UNDEFINED.

Definition at line 590 of file tokenI.H.

References Foam::noexcept, and UNDEFINED.

◆ error()

bool error ( ) const
inlinenoexcept

Token is ERROR.

Definition at line 596 of file tokenI.H.

References ERROR, and Foam::noexcept.

◆ isBool()

bool isBool ( ) const
inlinenoexcept

Token is BOOL.

Definition at line 602 of file tokenI.H.

References BOOL, and Foam::noexcept.

◆ isFlag()

bool isFlag ( ) const
inlinenoexcept

Token is FLAG.

Definition at line 632 of file tokenI.H.

References FLAG, and Foam::noexcept.

Referenced by UIPstreamBase::read().

Here is the caller graph for this function:

◆ isPunctuation() [1/2]

◆ isPunctuation() [2/2]

bool isPunctuation ( punctuationToken p) const
inlinenoexcept

True if token is PUNCTUATION and equal to parameter.

Definition at line 656 of file tokenI.H.

References p, and PUNCTUATION.

◆ isSeparator()

bool isSeparator ( ) const
inlinenoexcept

Token is PUNCTUATION and isseparator.

Definition at line 666 of file tokenI.H.

References isseparator(), Foam::noexcept, and PUNCTUATION.

Here is the call graph for this function:

◆ isIntType()

bool isIntType ( ) const
inlinenoexcept

Token is (int32 | int64 | uint32 | uint64).

Definition at line 696 of file tokenI.H.

References Foam::noexcept.

◆ is_int32()

bool is_int32 ( ) const
inlinenoexcept

Token is INTEGER_32 or is convertible to one.

Definition at line 722 of file tokenI.H.

References INTEGER_32, INTEGER_64, Foam::noexcept, UNSIGNED_INTEGER_32, and UNSIGNED_INTEGER_64.

Referenced by isLabel(), and Foam::operator>>().

Here is the caller graph for this function:

◆ is_int64()

bool is_int64 ( ) const
inlinenoexcept

Token is INTEGER_64 or is convertible to one.

Definition at line 753 of file tokenI.H.

References INTEGER_32, INTEGER_64, Foam::noexcept, UNSIGNED_INTEGER_32, and UNSIGNED_INTEGER_64.

Referenced by isLabel(), and Foam::operator>>().

Here is the caller graph for this function:

◆ is_uint32()

bool is_uint32 ( ) const
inlinenoexcept

Token is UNSIGNED_INTEGER_32 or is convertible to one.

Definition at line 781 of file tokenI.H.

References INTEGER_32, INTEGER_64, Foam::noexcept, UNSIGNED_INTEGER_32, and UNSIGNED_INTEGER_64.

Referenced by isULabel(), and Foam::operator>>().

Here is the caller graph for this function:

◆ is_uint64()

bool is_uint64 ( ) const
inlinenoexcept

Token is UNSIGNED_INTEGER_64 or is convertible to one.

Definition at line 812 of file tokenI.H.

References INTEGER_32, INTEGER_64, Foam::noexcept, UNSIGNED_INTEGER_32, and UNSIGNED_INTEGER_64.

Referenced by isULabel(), and Foam::operator>>().

Here is the caller graph for this function:

◆ isLabel() [1/2]

◆ isULabel()

bool isULabel ( ) const
inlinenoexcept

Integral token is convertible to Foam::uLabel.

Definition at line 856 of file tokenI.H.

References is_uint32(), is_uint64(), and Foam::noexcept.

Here is the call graph for this function:

◆ isLabel() [2/2]

bool isLabel ( const label value) const
inlinenoexcept

True if token is integer type and equal to parameter.

Definition at line 881 of file tokenI.H.

References INTEGER_32, INTEGER_64, UNSIGNED_INTEGER_32, and UNSIGNED_INTEGER_64.

◆ isFloat()

bool isFloat ( ) const
inlinenoexcept

Token is FLOAT.

Definition at line 917 of file tokenI.H.

References FLOAT, and Foam::noexcept.

Referenced by isFloatScalar().

Here is the caller graph for this function:

◆ isDouble()

bool isDouble ( ) const
inlinenoexcept

Token is DOUBLE.

Definition at line 944 of file tokenI.H.

References DOUBLE, and Foam::noexcept.

Referenced by isDoubleScalar().

Here is the caller graph for this function:

◆ isScalar()

bool isScalar ( ) const
inlinenoexcept

Token is FLOAT or DOUBLE.

Definition at line 971 of file tokenI.H.

References DOUBLE, FLOAT, and Foam::noexcept.

Referenced by isNumber(), Foam::operator>>(), Foam::operator>>(), Foam::operator>>(), Foam::operator>>(), and exprValue::peekType().

Here is the caller graph for this function:

◆ isNumber()

bool isNumber ( ) const
inlinenoexcept

Token is (signed/unsigned) integer type, FLOAT or DOUBLE.

Definition at line 992 of file tokenI.H.

References isScalar(), and Foam::noexcept.

Referenced by CrankNicolsonDdtScheme< Type >::CrankNicolsonDdtScheme(), Foam::getLazyPair(), Foam::getRadius(), Foam::operator>>(), Foam::operator>>(), exprValue::peekType(), Reaction< ThermoType >::reactionStrLeft(), dimensionSet::read(), dimensionSet::read(), Foam::readScaling(), and IOstreamOption::versionNumber::versionNumber().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isWord() [1/2]

◆ isWord() [2/2]

bool isWord ( const std::string & s) const
inline

Token is word-variant and equal to parameter.

Definition at line 1010 of file tokenI.H.

References isWord(), and s().

Here is the call graph for this function:

◆ isDirective()

bool isDirective ( ) const
inlinenoexcept

Token is DIRECTIVE (word variant).

Definition at line 1016 of file tokenI.H.

References DIRECTIVE, and Foam::noexcept.

Referenced by ifeqEntry::evaluate(), and ifeqEntry::execute().

Here is the caller graph for this function:

◆ isQuotedString()

bool isQuotedString ( ) const
inlinenoexcept

Token is (quoted) STRING (string variant).

Definition at line 1034 of file tokenI.H.

References Foam::noexcept, and STRING.

Referenced by fileName::assign(), keyType::assign(), wordRe::assign(), and Foam::operator>>().

Here is the caller graph for this function:

◆ isString()

bool isString ( ) const
inlinenoexcept

Token is string-variant (STRING, EXPRESSION, VARIABLE, VERBATIM, CHAR_DATA).

Definition at line 1040 of file tokenI.H.

References Foam::noexcept.

Referenced by Foam::exprTools::getList(), isStringType(), operator==(), Foam::operator>>(), and stringToken().

Here is the caller graph for this function:

◆ isExpression()

bool isExpression ( ) const
inlinenoexcept

Token is EXPRESSION (string variant).

Definition at line 1046 of file tokenI.H.

References EXPRESSION, and Foam::noexcept.

◆ isVariable()

bool isVariable ( ) const
inlinenoexcept

Token is VARIABLE (string variant).

Definition at line 1052 of file tokenI.H.

References Foam::noexcept, and VARIABLE.

Referenced by Foam::operator>>().

Here is the caller graph for this function:

◆ isVerbatim()

bool isVerbatim ( ) const
inlinenoexcept

Token is VERBATIM string (string variant).

Definition at line 1058 of file tokenI.H.

References Foam::noexcept, and VERBATIM.

◆ isCharData()

bool isCharData ( ) const
inlinenoexcept

Token is CHAR_DATA (string variant).

Definition at line 1064 of file tokenI.H.

References CHAR_DATA, and Foam::noexcept.

◆ isStringType()

bool isStringType ( ) const
inlinenoexcept

Token is word-variant or string-variant (WORD, DIRECTIVE, STRING, EXPRESSION, VARIABLE, VERBATIM, CHAR_DATA).

Definition at line 1070 of file tokenI.H.

References isString(), isWord(), and Foam::noexcept.

Referenced by functionEntry::readStringList(), and IOstreamOption::versionNumber::versionNumber().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isCompound() [1/3]

bool isCompound ( ) const
inlinenoexcept

◆ isCompound() [2/3]

bool isCompound ( const word & compoundType) const
inline

True if token is COMPOUND and its type() is equal to parameter.

Definition at line 1102 of file tokenI.H.

References COMPOUND.

◆ isCompound() [3/3]

template<class Type>
const Type * isCompound ( ) const
inline

If token is COMPOUND and can be dynamic_cast to the Type return a const pointer to the content.

Return nullptr on any failure.

Definition at line 1113 of file tokenI.H.

References COMPOUND.

◆ operator bool()

operator bool ( ) const
inlineexplicitnoexcept

True if token is not UNDEFINED or ERROR. Same as good().

Definition at line 1018 of file token.H.

References good(), and Foam::noexcept.

Here is the call graph for this function:

◆ boolToken() [1/2]

bool boolToken ( ) const
inline

Return boolean token value.

Report FatalIOError and return false if token is not BOOL or LABEL

Definition at line 608 of file tokenI.H.

References BOOL, and INTEGER_32.

Referenced by Foam::printTokenInfo().

Here is the caller graph for this function:

◆ boolToken() [2/2]

void boolToken ( bool on)
inline

Assign to a boolean token.

Definition at line 624 of file tokenI.H.

References BOOL, and reset().

Here is the call graph for this function:

◆ flagToken()

int flagToken ( ) const
inline

Return flag bitmask value.

Report FatalIOError and return NO_FLAG if token is not FLAG

Definition at line 638 of file tokenI.H.

References FLAG, and NO_FLAG.

Referenced by Foam::printTokenInfo(), and UIPstreamBase::read().

Here is the caller graph for this function:

◆ pToken() [1/2]

Foam::token::punctuationToken pToken ( ) const
inline

Return punctuation character.

Report FatalIOError and return \0 if token is not PUNCTUATION

Definition at line 676 of file tokenI.H.

References NULL_TOKEN, and PUNCTUATION.

Referenced by blockDescriptor::blockDescriptor(), operator=(), Foam::operator>>(), Foam::operator>>(), Foam::operator>>(), Foam::printTokenInfo(), ISstream::read(), primitiveEntry::read(), Istream::readBeginList(), and Istream::readEndList().

Here is the caller graph for this function:

◆ pToken() [2/2]

void pToken ( punctuationToken p)
inline

Assign to a punctuation token.

Definition at line 688 of file tokenI.H.

References p, PUNCTUATION, and reset().

Here is the call graph for this function:

◆ int32Token() [1/2]

int32_t int32Token ( ) const
inline

Return int32 value, convert from other integer type or Error.

Definition at line 739 of file tokenI.H.

Referenced by Foam::operator>>(), Foam::printTokenInfo(), ISstream::read(), and UIPstreamBase::read().

Here is the caller graph for this function:

◆ int32Token() [2/2]

void int32Token ( int32_t val)
inline

Assign a int32 value token.

Definition at line 745 of file tokenI.H.

References INTEGER_32, and reset().

Here is the call graph for this function:

◆ int64Token() [1/2]

int64_t int64Token ( ) const
inline

Return int64 value, convert from other integer type or Error.

Definition at line 767 of file tokenI.H.

Referenced by Foam::operator>>(), Foam::printTokenInfo(), ISstream::read(), and UIPstreamBase::read().

Here is the caller graph for this function:

◆ int64Token() [2/2]

void int64Token ( int64_t val)
inline

Assign a int64 value token.

Definition at line 773 of file tokenI.H.

References INTEGER_64, and reset().

Here is the call graph for this function:

◆ uint32Token() [1/2]

uint32_t uint32Token ( ) const
inline

Return int32 value, convert from other integer type or Error.

Definition at line 798 of file tokenI.H.

Referenced by Foam::operator>>(), Foam::printTokenInfo(), ISstream::read(), and UIPstreamBase::read().

Here is the caller graph for this function:

◆ uint32Token() [2/2]

void uint32Token ( uint32_t val)
inline

Assign a uint32 value token.

Definition at line 804 of file tokenI.H.

References reset(), and UNSIGNED_INTEGER_32.

Here is the call graph for this function:

◆ uint64Token() [1/2]

uint64_t uint64Token ( ) const
inline

Return int64 value, convert from other integer type or Error.

Definition at line 829 of file tokenI.H.

Referenced by Foam::operator>>(), Foam::printTokenInfo(), ISstream::read(), and UIPstreamBase::read().

Here is the caller graph for this function:

◆ uint64Token() [2/2]

void uint64Token ( uint64_t val)
inline

Assign a uint64 value token.

Definition at line 835 of file tokenI.H.

References reset(), and UNSIGNED_INTEGER_64.

Here is the call graph for this function:

◆ labelToken() [1/2]

◆ uLabelToken()

Foam::uLabel uLabelToken ( ) const
inline

Return integer type as uLabel value or Error.

Definition at line 875 of file tokenI.H.

◆ labelToken() [2/2]

void labelToken ( const label val)
inline

Assign to a label (int32 or int64) token.

Definition at line 900 of file tokenI.H.

References INTEGER_32, INTEGER_64, and reset().

Here is the call graph for this function:

◆ floatToken() [1/2]

float floatToken ( ) const
inline

Return float value.

Report FatalIOError and return 0 if token is not FLOAT

Definition at line 923 of file tokenI.H.

References FLOAT.

Referenced by floatScalarToken(), and Foam::printTokenInfo().

Here is the caller graph for this function:

◆ floatToken() [2/2]

void floatToken ( const float val)
inline

Assign to a float token.

Definition at line 936 of file tokenI.H.

References FLOAT, and reset().

Here is the call graph for this function:

◆ doubleToken() [1/2]

double doubleToken ( ) const
inline

Return double value.

Report FatalIOError and return 0 if token is not DOUBLE

Definition at line 950 of file tokenI.H.

References DOUBLE.

Referenced by doubleScalarToken(), and Foam::printTokenInfo().

Here is the caller graph for this function:

◆ doubleToken() [2/2]

void doubleToken ( const double val)
inline

Assign to a double token.

Definition at line 963 of file tokenI.H.

References DOUBLE, and reset().

Here is the call graph for this function:

◆ scalarToken()

Foam::scalar scalarToken ( ) const
inline

Return float or double value.

Report FatalIOError and return 0 if token is not a FLOAT or DOUBLE

Definition at line 981 of file tokenI.H.

References DOUBLE, and FLOAT.

Referenced by Foam::operator>>(), Foam::operator>>(), Foam::operator>>(), and Foam::operator>>().

Here is the caller graph for this function:

◆ number()

Foam::scalar number ( ) const
inline

Return label, float or double value.

Report FatalIOError and return 0 if token is not a an integer type, FLOAT or DOUBLE

Definition at line 998 of file tokenI.H.

Referenced by CrankNicolsonDdtScheme< Type >::CrankNicolsonDdtScheme(), Foam::operator>>(), Foam::operator>>(), Reaction< ThermoType >::reactionStrRight(), dimensionSet::read(), and dimensionSet::read().

Here is the caller graph for this function:

◆ wordToken()

const Foam::word & wordToken ( ) const
inline

Return const reference to the word contents.

Report FatalIOError and return "" if token is not a WORD or DIRECTIVE

Definition at line 1022 of file tokenI.H.

References isWord(), and word::null.

Referenced by fileName::assign(), keyType::assign(), wordRe::assign(), blockDescriptor::blockDescriptor(), ifeqEntry::evaluate(), ifeqEntry::execute(), blockVertex::New(), Foam::operator>>(), Foam::operator>>(), Foam::operator>>(), Foam::printTokenInfo(), Foam::blockMeshTools::read(), dimensionSet::read(), and OSstream::write().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ stringToken()

const Foam::string & stringToken ( ) const
inline

Return const reference to the string contents.

Report FatalIOError and return "" if token is not a STRING, EXPRESSION, VARIABLE, VERBATIM, CHAR_DATA or an upcast WORD or DIRECTIVE

Definition at line 1076 of file tokenI.H.

References isString(), isWord(), and string::null.

Referenced by fileName::assign(), keyType::assign(), wordRe::assign(), Foam::exprTools::getList(), Foam::operator>>(), Foam::operator>>(), Foam::printTokenInfo(), functionEntry::write(), OSstream::write(), and UOPstream::write().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ compoundToken()

const Foam::token::compound & compoundToken ( ) const
inline

Const reference to compound token. Fatal if the wrong type.

Definition at line 1124 of file tokenI.H.

References COMPOUND.

Referenced by Foam::printTokenInfo().

Here is the caller graph for this function:

◆ refCompoundToken() [1/2]

Foam::token::compound & refCompoundToken ( )
inline

Return reference to compound token. Fatal if the wrong type. No checks for released or pending states.

Definition at line 1134 of file tokenI.H.

References COMPOUND.

◆ refCompoundToken() [2/2]

template<class Type>
Type & refCompoundToken ( )
inline

Return reference to the underlying encapsulated container (eg, List<label> etc) of a compound token. No checks for released or pending states.

Definition at line 1145 of file tokenI.H.

References COMPOUND, and Foam::dynamicCast().

Here is the call graph for this function:

◆ readCompoundToken()

bool readCompoundToken ( const word & compoundType,
Istream & is,
const bool readContent = true )

Default construct the specified compound type and read from stream.

A no-op and returns false if compound type is unknown. Modify the token and return true on success.

Definition at line 125 of file token.C.

Referenced by Foam::readCompoundToken().

Here is the caller graph for this function:

◆ transferCompoundToken() [1/3]

Foam::token::compound & transferCompoundToken ( const Istream * is = nullptr)

Return reference to compound and mark internally as released.

Optional Istream parameter only as reference for errors messages.

Definition at line 157 of file token.C.

References Foam::abort(), COMPOUND, Foam::FatalError, FatalErrorInFunction, Foam::FatalIOError, FatalIOErrorInFunction, and info().

Referenced by mappedPatchBase::constructIOField(), DynamicList< T, SizeMin >::readList(), FixedList< T, N >::readList(), List< T >::readList(), UList< T >::readList(), and transferCompoundToken().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ transferCompoundToken() [2/3]

Foam::token::compound & transferCompoundToken ( const Istream & is)
inline

Return reference to compound and mark internally as released.

The Istream is used for reference error messages only.

Definition at line 1162 of file tokenI.H.

References transferCompoundToken().

Here is the call graph for this function:

◆ transferCompoundToken() [3/3]

template<class Type>
Type & transferCompoundToken ( const Istream & is)
inline

Mark the compound as released and return a reference to the underlying encapsulated container - eg, List<label>.

The Istream is used for reference error messages only.

Definition at line 1169 of file tokenI.H.

References Foam::dynamicCast(), and transferCompoundToken().

Here is the call graph for this function:

◆ reset()

void reset ( )
inline

Reset token to UNDEFINED and clear any allocated storage.

Definition at line 412 of file tokenI.H.

References CHAR_DATA, COMPOUND, DIRECTIVE, EXPRESSION, STRING, VARIABLE, VERBATIM, and WORD.

Referenced by Foam::operator>>(), ISstream::read(), ITstream::read(), and UIPstreamBase::read().

Here is the caller graph for this function:

◆ setBad()

void setBad ( )
inline

Clear token and set to be ERROR.

Definition at line 456 of file tokenI.H.

References ERROR, and reset().

Referenced by ISstream::read(), and UIPstreamBase::read().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ swap()

void swap ( token & tok)
inlinenoexcept

Swap token contents: type, data, line-number.

Definition at line 463 of file tokenI.H.

References token().

Referenced by operator=().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ read()

bool read ( Istream & is)

Read a token from Istream, calls reset() first.

Returns
token state as good() or not.

Definition at line 146 of file tokenIO.C.

References IOstream::good(), good(), Istream::read(), and reset().

Referenced by bitSet::readListToc().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ info()

◆ operator=() [1/17]

void operator= ( const token & tok)
inline

Copy assign.

Definition at line 1236 of file tokenI.H.

References CHAR_DATA, COMPOUND, DIRECTIVE, EXPRESSION, reset(), STRING, token(), VARIABLE, VERBATIM, and WORD.

Here is the call graph for this function:

◆ operator=() [2/17]

void operator= ( token && tok)
inline

Move assign.

Definition at line 1287 of file tokenI.H.

References reset(), swap(), and token().

Here is the call graph for this function:

◆ operator=() [3/17]

void operator= ( const punctuationToken p)
inline

Copy assign from punctuation.

Definition at line 1300 of file tokenI.H.

References p, and pToken().

Here is the call graph for this function:

◆ operator=() [4/17]

void operator= ( int32_t val)
inline

Copy assign from int32_t.

Definition at line 1306 of file tokenI.H.

References INTEGER_32, and reset().

Here is the call graph for this function:

◆ operator=() [5/17]

void operator= ( int64_t val)
inline

Copy assign from int64_t.

Definition at line 1314 of file tokenI.H.

References INTEGER_64, and reset().

Here is the call graph for this function:

◆ operator=() [6/17]

void operator= ( uint32_t val)
inline

Copy assign from uint32_t.

Definition at line 1322 of file tokenI.H.

References reset(), and UNSIGNED_INTEGER_32.

Here is the call graph for this function:

◆ operator=() [7/17]

void operator= ( uint64_t val)
inline

Copy assign from uint64_t.

Definition at line 1330 of file tokenI.H.

References reset(), and UNSIGNED_INTEGER_64.

Here is the call graph for this function:

◆ operator=() [8/17]

void operator= ( float val)
inline

Copy assign from float.

Definition at line 1338 of file tokenI.H.

References FLOAT, and reset().

Here is the call graph for this function:

◆ operator=() [9/17]

void operator= ( double val)
inline

Copy assign from double.

Definition at line 1346 of file tokenI.H.

References DOUBLE, and reset().

Here is the call graph for this function:

◆ operator=() [10/17]

void operator= ( const word & w)
inline

Copy assign from word content.

Definition at line 1354 of file tokenI.H.

References reset(), and WORD.

Here is the call graph for this function:

◆ operator=() [11/17]

void operator= ( const string & str)
inline

Copy assign from string content.

Definition at line 1362 of file tokenI.H.

References reset(), and STRING.

Here is the call graph for this function:

◆ operator=() [12/17]

void operator= ( word && w)
inline

Move assign from word content.

Definition at line 1370 of file tokenI.H.

References reset(), and WORD.

Here is the call graph for this function:

◆ operator=() [13/17]

void operator= ( string && str)
inline

Move assign from string content.

Definition at line 1378 of file tokenI.H.

References reset(), s(), and STRING.

Here is the call graph for this function:

◆ operator=() [14/17]

void operator= ( token::compound * ptr)
inline

Assign compound with reference counting to token.

Definition at line 1386 of file tokenI.H.

References COMPOUND, and reset().

Here is the call graph for this function:

◆ operator=() [15/17]

void operator= ( autoPtr< token::compound > && ptr)
inline

Move assign from compound pointer.

Definition at line 1394 of file tokenI.H.

References COMPOUND, and reset().

Here is the call graph for this function:

◆ operator==() [1/9]

bool operator== ( const token & tok) const
inline

Definition at line 1402 of file tokenI.H.

References BOOL, CHAR_DATA, COMPOUND, DIRECTIVE, DOUBLE, Foam::equal(), ERROR, EXPRESSION, FLAG, FLOAT, INTEGER_32, INTEGER_64, PUNCTUATION, STRING, token(), UNDEFINED, UNSIGNED_INTEGER_32, UNSIGNED_INTEGER_64, VARIABLE, VERBATIM, and WORD.

Referenced by operator!=(), operator!=(), operator!=(), operator!=(), operator!=(), operator!=(), operator!=(), operator!=(), and operator!=().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator==() [2/9]

bool operator== ( const punctuationToken p) const
inlinenoexcept

Definition at line 1465 of file tokenI.H.

References isPunctuation(), and p.

Here is the call graph for this function:

◆ operator==() [3/9]

bool operator== ( const int32_t val) const
inlinenoexcept

Definition at line 1482 of file tokenI.H.

References INTEGER_32.

◆ operator==() [4/9]

bool operator== ( const int64_t val) const
inlinenoexcept

Definition at line 1492 of file tokenI.H.

References INTEGER_64.

◆ operator==() [5/9]

bool operator== ( const uint32_t val) const
inlinenoexcept

Definition at line 1502 of file tokenI.H.

References UNSIGNED_INTEGER_32.

◆ operator==() [6/9]

bool operator== ( const uint64_t val) const
inlinenoexcept

Definition at line 1512 of file tokenI.H.

References UNSIGNED_INTEGER_64.

◆ operator==() [7/9]

bool operator== ( const float val) const
inlinenoexcept

Definition at line 1522 of file tokenI.H.

References Foam::equal(), and FLOAT.

Here is the call graph for this function:

◆ operator==() [8/9]

bool operator== ( const double val) const
inlinenoexcept

Definition at line 1532 of file tokenI.H.

References DOUBLE, and Foam::equal().

Here is the call graph for this function:

◆ operator==() [9/9]

bool operator== ( const std::string & s) const
inline

Definition at line 1471 of file tokenI.H.

References isString(), isWord(), and s().

Here is the call graph for this function:

◆ operator!=() [1/9]

bool operator!= ( const token & t) const
inline

Definition at line 1351 of file token.H.

References operator==(), and token().

Here is the call graph for this function:

◆ operator!=() [2/9]

bool operator!= ( punctuationToken p) const
inlinenoexcept

Definition at line 1352 of file token.H.

References operator==(), and p.

Here is the call graph for this function:

◆ operator!=() [3/9]

bool operator!= ( int32_t b) const
inlinenoexcept

Definition at line 1356 of file token.H.

References b, and operator==().

Here is the call graph for this function:

◆ operator!=() [4/9]

bool operator!= ( int64_t b) const
inlinenoexcept

Definition at line 1357 of file token.H.

References b, and operator==().

Here is the call graph for this function:

◆ operator!=() [5/9]

bool operator!= ( uint32_t b) const
inlinenoexcept

Definition at line 1358 of file token.H.

References b, and operator==().

Here is the call graph for this function:

◆ operator!=() [6/9]

bool operator!= ( uint64_t b) const
inlinenoexcept

Definition at line 1359 of file token.H.

References b, and operator==().

Here is the call graph for this function:

◆ operator!=() [7/9]

bool operator!= ( float b) const
inlinenoexcept

Definition at line 1360 of file token.H.

References b, and operator==().

Here is the call graph for this function:

◆ operator!=() [8/9]

bool operator!= ( double b) const
inlinenoexcept

Definition at line 1361 of file token.H.

References b, and operator==().

Here is the call graph for this function:

◆ operator!=() [9/9]

bool operator!= ( const std::string & s) const
inline

Definition at line 1362 of file token.H.

References operator==(), and s().

Here is the call graph for this function:

◆ lineNumber() [3/3]

label & lineNumber ( )
inlinenoexcept

Write access for the token line number.

Deprecated
(2021-03) - use lineNumber(label)

Definition at line 1382 of file token.H.

References Foam::noexcept.

◆ isFloatScalar()

bool isFloatScalar ( ) const
inlinenoexcept

Token is FLOAT.

Deprecated
(2020-01) - isFloat()

Definition at line 1389 of file token.H.

References isFloat(), and Foam::noexcept.

Here is the call graph for this function:

◆ isDoubleScalar()

bool isDoubleScalar ( ) const
inlinenoexcept

Token is DOUBLE.

Deprecated
(2020-01) - isDouble()

Definition at line 1396 of file token.H.

References isDouble(), and Foam::noexcept.

Here is the call graph for this function:

◆ floatScalarToken()

float floatScalarToken ( ) const
inline

Return float value.

Deprecated
(2020-01) - floatToken()

Definition at line 1403 of file token.H.

References floatToken().

Here is the call graph for this function:

◆ doubleScalarToken()

double doubleScalarToken ( ) const
inline

Return double value.

Deprecated
(2020-01) - doubleToken()

Definition at line 1410 of file token.H.

References doubleToken().

Here is the call graph for this function:

◆ operator=() [16/17]

void operator= ( word * )
delete

Deprecated(2017-11) transfer word pointer to the token.

Deprecated
(2017-11) - use move assign from word

◆ operator=() [17/17]

void operator= ( string * )
delete

Deprecated(2017-11) transfer string pointer to the token.

Deprecated
(2017-11) - use move assign from string

◆ operator<< [1/4]

Ostream & operator<< ( Ostream & os,
const token & tok )
friend

References os(), and token().

◆ operator<< [2/4]

Ostream & operator<< ( Ostream & os,
const punctuationToken & pt )
friend

References os().

◆ operator<< [3/4]

ostream & operator<< ( ostream & os,
const punctuationToken & pt )
friend

References os().

◆ operator<< [4/4]

ostream & operator<< ( ostream & os,
const InfoProxy< token > & ip )
friend

References os().

Member Data Documentation

◆ undefinedToken

const Foam::token undefinedToken
static

An undefined token.

Definition at line 570 of file token.H.

Referenced by Istream::peekBack().

◆ typeName

const char* const typeName = "token"
staticconstexpr

The type name is "token".

Definition at line 663 of file token.H.


The documentation for this class was generated from the following files:
  • src/OpenFOAM/db/IOstreams/token/token.H
  • src/OpenFOAM/db/IOstreams/token/token.C
  • src/OpenFOAM/db/IOstreams/token/tokenI.H
  • src/OpenFOAM/db/IOstreams/token/tokenIO.C