Class TokenFunc

Class Documentation

class IfcParse::TokenFunc

Provides functions to convert Tokens to binary data Tokens are merely offsets to where they can be read in the file

Public Static Functions

bool isString(const Token &t)

Returns the offset at which the token is read from the file.

Returns whether the token can be interpreted as a string

bool isIdentifier(const Token &t)

Returns whether the token can be interpreted as an identifier.

bool isOperator(const Token &t)

Returns whether the token can be interpreted as a syntactical operator.

bool isOperator(const Token &t, char op)

Returns whether the token is a given operator.

bool isEnumeration(const Token &t)

Returns whether the token can be interpreted as an enumerated value.

bool isKeyword(const Token &t)

Returns whether the token can be interpreted as a datatype name.

bool isInt(const Token &t)

Returns whether the token can be interpreted as an integer.

bool isBool(const Token &t)

Returns whether the token can be interpreted as a boolean.

bool isFloat(const Token &t)

Returns whether the token can be interpreted as a floating point number.

bool isBinary(const Token &t)

Returns whether the token can be interpreted as a binary type.

int asInt(const Token &t)

Returns the token interpreted as an integer.

int asIdentifier(const Token &t)

Returns the token interpreted as an identifier.

bool asBool(const Token &t)

Returns the token interpreted as an boolean (.T. or .F.)

double asFloat(const Token &t)

Returns the token as a floating point number.

std::string asString(const Token &t)

Returns the token as a string (without the dot or apostrophe)

const std::string &asStringRef(const Token &t)

Returns the token as a string in internal buffer (for optimization purposes)

boost::dynamic_bitset asBinary(const Token &t)

Returns the token as a string (without the dot or apostrophe)

std::string toString(const Token &t)

Returns a string representation of the token (including the dot or apostrophe)