A token holds an item read from Istream. More...
#include <token.H>

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 word & | wordToken () const |
| Return const reference to the word contents. | |
| const string & | stringToken () const |
| Return const reference to the string contents. | |
| const compound & | compoundToken () const |
| Const reference to compound token. Fatal if the wrong type. | |
| compound & | refCompoundToken () |
| 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. | |
| compound & | transferCompoundToken (const Istream *is=nullptr) |
| Return reference to compound and mark internally as released. | |
| compound & | transferCompoundToken (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< token > | info () 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 | |
| Ostream & | operator<< (Ostream &os, const token &tok) |
| Ostream & | operator<< (Ostream &os, const punctuationToken &pt) |
| ostream & | operator<< (ostream &os, const punctuationToken &pt) |
| ostream & | operator<< (ostream &os, const InfoProxy< token > &ip) |
A token holds an item read from Istream.
bool and int are otherwise indistinguishable| 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 | |
| STRING | Foam::string (usually double-quoted). |
| COMPOUND | |
| DIRECTIVE | Word-variant: dictionary |
| EXPRESSION | String-variant: math expression for evaluation stored with delimiters |
| VARIABLE | String-variant: dictionary |
| 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 |
| enum flagType |
| 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. |
|
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().

|
inline |
|
inlinenoexcept |
Move construct. The original token is left as UNDEFINED.
Definition at line 212 of file tokenI.H.
References Foam::noexcept, and token().

|
inlineexplicitnoexcept |
Construct punctuation character token.
Definition at line 223 of file tokenI.H.
References Foam::noexcept, p, and PUNCTUATION.
|
inlineexplicitnoexcept |
Construct 32-bit integer token.
Definition at line 233 of file tokenI.H.
References INTEGER_32, and Foam::noexcept.
|
inlineexplicitnoexcept |
Construct 64-bit integer token.
Definition at line 243 of file tokenI.H.
References INTEGER_64, and Foam::noexcept.
|
inlineexplicitnoexcept |
Construct unsigned 32-bit integer token.
Definition at line 253 of file tokenI.H.
References Foam::noexcept, and UNSIGNED_INTEGER_32.
|
inlineexplicitnoexcept |
Construct unsigned 64-bit integer token.
Definition at line 263 of file tokenI.H.
References Foam::noexcept, and UNSIGNED_INTEGER_64.
|
inlineexplicitnoexcept |
Construct float token.
Definition at line 273 of file tokenI.H.
References FLOAT, and Foam::noexcept.
|
inlineexplicitnoexcept |
Construct double token.
Definition at line 283 of file tokenI.H.
References DOUBLE, and Foam::noexcept.
|
inlineexplicit |
|
inlineexplicit |
|
inlineexplicit |
|
inlineexplicit |
|
inlineexplicit |
|
inlineexplicit |
|
inlineexplicit |
|
inlineexplicit |
|
explicit |
Construct from Istream.
Definition at line 136 of file tokenIO.C.
References Istream::read(), and token().

|
inline |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
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.
| c | the 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().

|
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.
|
inline |
|
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().

|
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.
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().

|
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().

|
inlinenoexcept |
|
inlinenoexcept |
True if token is not UNDEFINED or ERROR.
Definition at line 584 of file tokenI.H.
References ERROR, Foam::noexcept, and UNDEFINED.
Referenced by wordDirective::execute(), wordDirective::execute(), decomposedBlockData::getNumBlocks(), operator bool(), Foam::operator>>(), Foam::operator>>(), Foam::operator>>(), Foam::operator>>(), Foam::operator>>(), Foam::operator>>(), Foam::operator>>(), Foam::operator>>(), Foam::operator>>(), Foam::operator>>(), Foam::operator>>(), Foam::parseStream(), exprValue::peekType(), exprValue::read(), primitiveEntry::read(), read(), decomposedBlockData::readBlockEntry(), and OTstream::write().

|
inlinenoexcept |
Token is UNDEFINED.
Definition at line 590 of file tokenI.H.
References Foam::noexcept, and UNDEFINED.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Token is FLAG.
Definition at line 632 of file tokenI.H.
References FLAG, and Foam::noexcept.
Referenced by UIPstreamBase::read().

|
inlinenoexcept |
Token is PUNCTUATION.
Definition at line 650 of file tokenI.H.
References Foam::noexcept, and PUNCTUATION.
Referenced by blockDescriptor::blockDescriptor(), dictionaryListEntry::dictionaryListEntry(), ITstream::find(), Foam::exprTools::getList(), blockVertex::New(), entry::New(), operator==(), Foam::operator>>(), Foam::operator>>(), Foam::operator>>(), Foam::operator>>(), Foam::operator>>(), exprValue::peekType(), Foam::blockMeshTools::read(), exprValue::read(), primitiveEntry::read(), IOPosition< CloudType >::readData(), DynamicList< T, SizeMin >::readList(), FixedList< T, N >::readList(), List< T >::readList(), LList< LListBase, T >::readList(), PackedList< Width >::readList(), UList< T >::readList(), and Reaction< ReactionThermo >::setLRhs().

|
inlinenoexcept |
True if token is PUNCTUATION and equal to parameter.
Definition at line 656 of file tokenI.H.
References p, and PUNCTUATION.
|
inlinenoexcept |
Token is PUNCTUATION and isseparator.
Definition at line 666 of file tokenI.H.
References isseparator(), Foam::noexcept, and PUNCTUATION.

|
inlinenoexcept |
Token is (int32 | int64 | uint32 | uint64).
Definition at line 696 of file tokenI.H.
References Foam::noexcept.
|
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>>().

|
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>>().

|
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>>().

|
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>>().

|
inlinenoexcept |
Integral token is convertible to Foam::label.
Definition at line 843 of file tokenI.H.
References is_int32(), is_int64(), and Foam::noexcept.
Referenced by dictionaryListEntry::dictionaryListEntry(), Foam::exprTools::getList(), entry::New(), Foam::operator>>(), Foam::operator>>(), Foam::operator>>(), exprValue::peekType(), Foam::blockMeshTools::read(), Foam::blockMeshTools::read(), STARCDedgeFormat::read(), STARCDsurfaceFormat< Face >::read(), STARCDMeshReader::readBoundary(), STARCDMeshReader::readCells(), IOPosition< CloudType >::readData(), PtrList< T >::readIstream(), DynamicList< T, SizeMin >::readList(), FixedList< T, N >::readList(), List< T >::readList(), LList< LListBase, T >::readList(), PackedList< Width >::readList(), UList< T >::readList(), bitSet::readListToc(), Matrix< Form, Type >::readMatrix(), STARCDCore::readPoints(), STARCDMeshReader::readPoints(), and decomposedBlockData::skipBlockEntry().


|
inlinenoexcept |
Integral token is convertible to Foam::uLabel.
Definition at line 856 of file tokenI.H.
References is_uint32(), is_uint64(), and Foam::noexcept.

|
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.
|
inlinenoexcept |
Token is FLOAT.
Definition at line 917 of file tokenI.H.
References FLOAT, and Foam::noexcept.
Referenced by isFloatScalar().

|
inlinenoexcept |
Token is DOUBLE.
Definition at line 944 of file tokenI.H.
References DOUBLE, and Foam::noexcept.
Referenced by isDoubleScalar().

|
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().

|
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().


|
inlinenoexcept |
Token is word-variant (WORD, DIRECTIVE).
Definition at line 1004 of file tokenI.H.
References Foam::noexcept.
Referenced by arcEdge::arcEdge(), Field< Type >::assign(), fileName::assign(), keyType::assign(), wordRe::assign(), blockDescriptor::blockDescriptor(), decomposedBlockData::getNumBlocks(), isStringType(), isWord(), blockVertex::New(), operator==(), Foam::operator>>(), Foam::operator>>(), Foam::operator>>(), genericPatchFieldBase::processEntry(), Foam::blockMeshTools::read(), dimensionSet::read(), decomposedBlockData::readBlockEntry(), IOobject::readHeader(), exprValue::readTokens(), decomposedBlockData::skipBlockEntry(), stringToken(), and wordToken().

|
inline |
|
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().

|
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>>().

|
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().

|
inlinenoexcept |
Token is EXPRESSION (string variant).
Definition at line 1046 of file tokenI.H.
References EXPRESSION, and Foam::noexcept.
|
inlinenoexcept |
Token is VARIABLE (string variant).
Definition at line 1052 of file tokenI.H.
References Foam::noexcept, and VARIABLE.
Referenced by Foam::operator>>().

|
inlinenoexcept |
Token is VERBATIM string (string variant).
Definition at line 1058 of file tokenI.H.
References Foam::noexcept, and VERBATIM.
|
inlinenoexcept |
Token is CHAR_DATA (string variant).
Definition at line 1064 of file tokenI.H.
References CHAR_DATA, and Foam::noexcept.
|
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().


|
inlinenoexcept |
Token is COMPOUND.
Definition at line 1096 of file tokenI.H.
References COMPOUND, and Foam::noexcept.
Referenced by mappedPatchBase::constructIOField(), decomposedBlockData::readBlockEntry(), DynamicList< T, SizeMin >::readList(), FixedList< T, N >::readList(), List< T >::readList(), UList< T >::readList(), and decomposedBlockData::skipBlockEntry().

|
inline |
|
inline |
|
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.

|
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().

|
inline |
|
inline |
Return flag bitmask value.
Report FatalIOError and return NO_FLAG if token is not FLAG
Definition at line 638 of file tokenI.H.
Referenced by Foam::printTokenInfo(), and UIPstreamBase::read().

|
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().

|
inline |
Assign to a punctuation token.
Definition at line 688 of file tokenI.H.
References p, PUNCTUATION, and reset().

|
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().

|
inline |
Assign a int32 value token.
Definition at line 745 of file tokenI.H.
References INTEGER_32, and reset().

|
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().

|
inline |
Assign a int64 value token.
Definition at line 773 of file tokenI.H.
References INTEGER_64, and reset().

|
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().

|
inline |
Assign a uint32 value token.
Definition at line 804 of file tokenI.H.
References reset(), and UNSIGNED_INTEGER_32.

|
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().

|
inline |
Assign a uint64 value token.
Definition at line 835 of file tokenI.H.
References reset(), and UNSIGNED_INTEGER_64.

|
inline |
Return integer type as label value or Error.
Definition at line 869 of file tokenI.H.
Referenced by dictionaryListEntry::dictionaryListEntry(), Foam::operator>>(), Foam::operator>>(), Foam::operator>>(), Foam::blockMeshTools::read(), Foam::blockMeshTools::read(), STARCDsurfaceFormat< Face >::read(), STARCDMeshReader::readCells(), IOPosition< CloudType >::readData(), PtrList< T >::readIstream(), DynamicList< T, SizeMin >::readList(), FixedList< T, N >::readList(), List< T >::readList(), LList< LListBase, T >::readList(), PackedList< Width >::readList(), UList< T >::readList(), bitSet::readListToc(), Matrix< Form, Type >::readMatrix(), STARCDCore::readPoints(), STARCDMeshReader::readPoints(), and decomposedBlockData::skipBlockEntry().

|
inline |
|
inline |
Assign to a label (int32 or int64) token.
Definition at line 900 of file tokenI.H.
References INTEGER_32, INTEGER_64, and reset().

|
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().

|
inline |
|
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().

|
inline |
|
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.
Referenced by Foam::operator>>(), Foam::operator>>(), Foam::operator>>(), and Foam::operator>>().

|
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().

|
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().


|
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().


|
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().

|
inline |
|
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().

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().

| 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().


|
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().

|
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().

|
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().

|
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().


|
inlinenoexcept |
Swap token contents: type, data, line-number.
Definition at line 463 of file tokenI.H.
References token().
Referenced by operator=().


| bool read | ( | Istream & | is | ) |
Read a token from Istream, calls reset() first.
Definition at line 146 of file tokenIO.C.
References IOstream::good(), good(), Istream::read(), and reset().
Referenced by bitSet::readListToc().


Return info proxy, for printing token information to a stream.
Definition at line 1253 of file token.H.
References Foam::noexcept.
Referenced by Field< Type >::assign(), blockDescriptor::blockDescriptor(), dictionaryListEntry::dictionaryListEntry(), blockVertex::New(), entry::New(), Foam::operator>>(), Foam::operator>>(), Foam::operator>>(), Foam::operator>>(), Foam::operator>>(), Foam::operator>>(), Foam::operator>>(), Foam::operator>>(), Foam::operator>>(), Foam::operator>>(), Foam::operator>>(), Foam::operator>>(), Foam::blockMeshTools::read(), Foam::blockMeshTools::read(), Istream::readBegin(), Istream::readBeginList(), IOPosition< CloudType >::readData(), Istream::readEnd(), Istream::readEndList(), DynamicList< T, SizeMin >::readList(), FixedList< T, N >::readList(), List< T >::readList(), LList< LListBase, T >::readList(), PackedList< Width >::readList(), UList< T >::readList(), bitSet::readListToc(), Matrix< Form, Type >::readMatrix(), and transferCompoundToken().

|
inline |
|
inline |
|
inline |
|
inline |
Copy assign from int32_t.
Definition at line 1306 of file tokenI.H.
References INTEGER_32, and reset().

|
inline |
Copy assign from int64_t.
Definition at line 1314 of file tokenI.H.
References INTEGER_64, and reset().

|
inline |
Copy assign from uint32_t.
Definition at line 1322 of file tokenI.H.
References reset(), and UNSIGNED_INTEGER_32.

|
inline |
Copy assign from uint64_t.
Definition at line 1330 of file tokenI.H.
References reset(), and UNSIGNED_INTEGER_64.

|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
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!=().


|
inlinenoexcept |
Definition at line 1465 of file tokenI.H.
References isPunctuation(), and p.

|
inlinenoexcept |
Definition at line 1482 of file tokenI.H.
References INTEGER_32.
|
inlinenoexcept |
Definition at line 1492 of file tokenI.H.
References INTEGER_64.
|
inlinenoexcept |
Definition at line 1502 of file tokenI.H.
References UNSIGNED_INTEGER_32.
|
inlinenoexcept |
Definition at line 1512 of file tokenI.H.
References UNSIGNED_INTEGER_64.
|
inlinenoexcept |
Definition at line 1522 of file tokenI.H.
References Foam::equal(), and FLOAT.

|
inlinenoexcept |
Definition at line 1532 of file tokenI.H.
References DOUBLE, and Foam::equal().

|
inline |
Definition at line 1471 of file tokenI.H.
References isString(), isWord(), and s().

|
inline |
Definition at line 1351 of file token.H.
References operator==(), and token().

|
inlinenoexcept |
Definition at line 1352 of file token.H.
References operator==(), and p.

|
inlinenoexcept |
Definition at line 1356 of file token.H.
References b, and operator==().

|
inlinenoexcept |
Definition at line 1357 of file token.H.
References b, and operator==().

|
inlinenoexcept |
Definition at line 1358 of file token.H.
References b, and operator==().

|
inlinenoexcept |
Definition at line 1359 of file token.H.
References b, and operator==().

|
inlinenoexcept |
Definition at line 1360 of file token.H.
References b, and operator==().

|
inlinenoexcept |
Definition at line 1361 of file token.H.
References b, and operator==().

|
inline |
Definition at line 1362 of file token.H.
References operator==(), and s().

|
inlinenoexcept |
Write access for the token line number.
Definition at line 1382 of file token.H.
References Foam::noexcept.
|
inlinenoexcept |
Token is FLOAT.
Definition at line 1389 of file token.H.
References isFloat(), and Foam::noexcept.

|
inlinenoexcept |
Token is DOUBLE.
Definition at line 1396 of file token.H.
References isDouble(), and Foam::noexcept.

|
inline |
Return float value.
Definition at line 1403 of file token.H.
References floatToken().

|
inline |
Return double value.
Definition at line 1410 of file token.H.
References doubleToken().

|
delete |
Deprecated(2017-11) transfer word pointer to the token.
|
delete |
Deprecated(2017-11) transfer string pointer to the token.
|
friend |
References os().
|
friend |
References os().
|
static |
|
staticconstexpr |