cgv
|
a typed token also stores the type and value of a parsed token. More...
#include <advanced_scan.h>
Public Member Functions | |
typed_token (const token &t, token_type tt=PLAIN) | |
![]() | |
token () | |
construct with both pointers set to 0 | |
token (const char *_str) | |
construct from c-string | |
token (const char *_b, const char *_e) | |
construct from character range | |
token (const std::string &s) | |
construct from string | |
size_t | get_length () const |
return the length of the token in number of characters | |
size_t | size () const |
return the length of the token in number of characters | |
bool | empty () const |
return whether the token is empty | |
void | skip (const std::string &skip_chars) |
set begin by skipping all instances of the given character set | |
void | reverse_skip (const std::string &skip_chars) |
set end by skipping all instances of the given character set | |
char | operator[] (unsigned int i) const |
return the i-th character of the token | |
bool | operator== (const char *s) const |
compare to const char* | |
bool | operator== (const std::string &s) const |
compare to string | |
bool | operator!= (const char *s) const |
compare to const char* | |
bool | operator!= (const std::string &s) const |
compare to string | |
Public Attributes | |
token_type | type |
double | float_value |
utils::time | time_value |
utils::date | date_value |
![]() | |
const char * | begin |
pointers that define the range of characters | |
const char * | end |
a typed token also stores the type and value of a parsed token.
Although a union of the different typed values should have been used, the values of different type are stored successively in the typed_token because of problems with standard construction.
Definition at line 33 of file advanced_scan.h.
|
inline |
Definition at line 36 of file advanced_scan.h.
utils::date cgv::utils::typed_token::date_value |
Definition at line 39 of file advanced_scan.h.
double cgv::utils::typed_token::float_value |
Definition at line 37 of file advanced_scan.h.
utils::time cgv::utils::typed_token::time_value |
Definition at line 38 of file advanced_scan.h.
token_type cgv::utils::typed_token::type |
Definition at line 35 of file advanced_scan.h.