Tokens model atomic data for stream IO.
|
Public Types |
enum | TokenType {
None,
Begin,
End,
String,
Option,
Integer,
Integer16,
Float,
Binary
} |
| Token types:. More...
|
Public Member Functions |
| Token (void) |
| Empty constructor, constructs None token.
|
| Token (const Token &rToken) |
| Copy constructor.
|
| ~Token (void) |
| Token destructor.
|
Token & | operator= (const Token &rOther) |
| Assignment operator.
|
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.
|
void | SetBinary (const char *data, long int len) |
| Initialize Binary 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.
|
Static Public Member Functions |
static void | WriteBinary (std::ostream *pStream, const char *pData, long int len) |
| Write specified binary data as base64 string to output stream.
|
Private Member Functions |
void | WriteString (std::ostream *pStream, char stop) |
| Write a std::string value to an output stream.
|
void | WriteBinary (std::ostream *pStream) |
| Write my binary data as base64 string to output stream.
|
bool | ReadNumber (std::istream *pStream) |
| Read a number from an input file stream.
|
int | ReadBinary (std::istream *pStream) |
| Read a base64 binary string from an input file stream.
|
int | 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).
|