|
| | TCODParser () |
| | Use this function to create a generic parser.
|
|
| TCODParser (const TCODParser &)=delete |
|
TCODParser & | operator= (const TCODParser &)=delete |
|
| TCODParser (TCODParser &&rhs) noexcept |
|
TCODParser & | operator= (TCODParser &&rhs) noexcept |
| TCODParserStruct * | newStructure (const char *name) |
|
TCOD_value_type_t | newCustomType (TCOD_parser_custom_t custom_type_parser) |
| void | run (const char *filename, ITCODParserListener *listener=NULL) |
| | Once you defined all the structure types and created your listener, you can start the actual parsing of the file :
|
| | ~TCODParser () |
| | Once you've done with the file parsing, you can release the resources used by the parser :
|
|
void | error (const char *msg,...) |
|
bool | hasProperty (const char *name) const |
|
bool | getBoolProperty (const char *name) const |
|
int | getIntProperty (const char *name) const |
|
int | getCharProperty (const char *name) const |
|
float | getFloatProperty (const char *name) const |
|
TCODColor | getColorProperty (const char *name) const |
|
TCOD_dice_t | getDiceProperty (const char *name) const |
|
const char * | getStringProperty (const char *name) const |
|
void * | getCustomProperty (const char *name) const |
|
TCOD_list_t | getListProperty (const char *name, TCOD_value_type_t type) const |
|
|
bool | new_struct (TCOD_parser_struct_t def, const char *name) noexcept |
|
bool | end_struct (TCOD_parser_struct_t def, const char *name) noexcept |
◆ TCODParser()
| TCODParser::TCODParser |
( |
| ) |
|
Use this function to create a generic parser.
Then you'll specialize this parser by defining the structures it can read.
◆ ~TCODParser()
| TCODParser::~TCODParser |
( |
| ) |
|
Once you've done with the file parsing, you can release the resources used by the parser :
- Parameters
-
| parser | In the C version, the parser handler, returned by TCOD_parser_new. |
◆ newStructure()
- Parameters
-
| parser | In the C version, the parser handler, returned by TCOD_parser_new. |
| name | The name of the structure type (in the example, this would be "item_type"). |
TCODParser parser(); TCODParserStruct *itemTypeStruct = parser.newStructure("item_type");
TCOD_parser_t parser = TCOD_parser_new(); TCOD_parser_struct_t item_type_struct = TCOD_parser_new_struct(parser, "item_type");
parser=libtcod.parser_new() item_type_struct = libtcod.parser_new_struct(parser, "item_type")
◆ run()
Once you defined all the structure types and created your listener, you can start the actual parsing of the file :
- Parameters
-
| parser | In the C version, the parser handler, returned by TCOD_parser_new. |
| filename | The name of the text file to parse, absolute or relative to current directory. |
| listener | The listener containing the callbacks. Use NULL for the default listener |
The documentation for this class was generated from the following file:
- C:/Users/4b796/Projects/libtcod/src/libtcod/parser.hpp