#include <token.h>
A Token models a string or numeric datum that can be read from a or written to a C++ stream. The class itself implements the representation of the data including its type. For section handling and actual file processing see TokenReader and TokenWriter.
mType | faudes::TokenType of the Token | |
mStringValue | Token value as C++-type std::string | |
mIntegerValue | Token value as C++-type long integer | |
mFloatValue | Token value of C++-type double |
Definition at line 52 of file token.h.
Public Types | |
enum | TokenType { None, Begin, End, String, Option, Integer, Integer16, Float } |
Token types:. More... | |
Public Member Functions | |
Token (void) | |
Empty constructor, constructs None token. | |
Token (const Token &rToken) | |
Copy constructor. | |
~Token (void) | |
Token destructor. | |
void | SetNone (void) |
Initialize None token. | |
void | SetString (const std::string &rName) |
Initialize as String token. | |
void | SetBegin (const std::string &rName) |
Initialize as Begin token. | |
void | SetEnd (const std::string &rName) |
Initialize as End token. | |
void | SetOption (const std::string &rName) |
Initialize as Option token. | |
void | SetInteger (const long int number) |
Initialize as Integer token. | |
void | SetInteger16 (const long int number) |
Initialize as Integer16 token. | |
void | SetFloat (const double number) |
Initialize as Float token. | |
long int | IntegerValue (void) const |
Get integer value of a numeric token. | |
double | FloatValue (void) const |
Get float value of a numeric token. | |
const std::string & | StringValue (void) const |
Get string value of a name token. | |
TokenType | Type (void) const |
Get token Type. | |
int | Read (std::istream *pStream) |
Read Token from input stream. | |
void | Write (std::ostream *pStream) |
Write Token to output stream. | |
Private Member Functions | |
bool | ReadNumber (std::istream *pStream) |
Read a number from an input file stream. | |
bool | ReadString (std::istream *pStream, char stop) |
Read a std::string value from an input file stream. | |
int | ReadSpace (std::istream *pStream) |
Read (ignore) spaces and comments in an input file stream. | |
Private Attributes | |
TokenType | mType |
Token type. | |
std::string | mStringValue |
Token std::string value (if Token is of type Name, Begein or End). | |
long int | mIntegerValue |
Token integer value (if Token is of type Integer or Integer16). | |
double | mFloatValue |
Token float value (if Token is of type Float). |
|
Token types:.
|
|
Empty constructor, constructs None token.
|
|
Copy constructor.
|
|
Token destructor.
|
|
Get float value of a numeric token.
|
|
Get integer value of a numeric token.
|
|
Read Token from input stream.
|
|
Read a number from an input file stream.
|
|
Read (ignore) spaces and comments in an input file stream.
|
|
Read a std::string value from an input file stream.
|
|
Initialize as Begin token.
|
|
Initialize as End token.
|
|
Initialize as Float token.
|
|
Initialize as Integer token.
|
|
Initialize as Integer16 token.
|
|
Initialize None token.
|
|
Initialize as Option token.
|
|
Initialize as String token.
|
|
Get string value of a name token.
|
|
Get token Type.
|
|
Write Token to output stream.
|
|
Token float value (if Token is of type Float).
|
|
Token integer value (if Token is of type Integer or Integer16).
|
|
Token std::string value (if Token is of type Name, Begein or End).
|
|
Token type.
|