#include <worldfile.hh>
Classes | |
class | CEntity |
class | CMacro |
class | CToken |
Public Member Functions | |
int | GetEntityCount () |
int | GetEntityParent (int entity) |
const char * | GetEntityType (int entity) |
CProperty * | GetProperty (int entity, const char *name) |
const char * | GetPropertyValue (CProperty *property, int index) |
bool | Load (const std::string &filename) |
int | LookupEntity (const char *type) |
bool | PropertyExists (int section, const char *token) |
double | ReadAngle (int entity, const char *name, double value) |
uint32_t | ReadColor (int entity, const char *name, uint32_t value) |
const char * | ReadFilename (int entity, const char *name, const char *value) |
double | ReadFloat (int entity, const char *name, double value) |
int | ReadInt (int entity, const char *name, int value) |
double | ReadLength (int entity, const char *name, double value) |
const std::string | ReadString (int entity, const char *name, const std::string &value) |
int | ReadTuple (const int entity, const char *name, const unsigned int first, const unsigned int num, const char *format,...) |
bool | Save (const std::string &filename) |
bool | WarnUnused () |
Worldfile () | |
void | WriteFloat (int entity, const char *name, double value) |
void | WriteInt (int entity, const char *name, int value) |
void | WriteLength (int entity, const char *name, double value) |
void | WriteString (int entity, const char *name, const std::string &value) |
void | WriteTuple (const int entity, const char *name, const unsigned int first, const unsigned int count, const char *format,...) |
~Worldfile () | |
Public Attributes | |
std::string | filename |
double | unit_angle |
double | unit_length |
Protected Member Functions | |
FILE * | FileOpen (const std::string &filename, const char *method) |
Private Types | |
enum | { TokenComment, TokenWord, TokenNum, TokenString, TokenOpenEntity, TokenCloseEntity, TokenOpenTuple, TokenCloseTuple, TokenSpace, TokenEOL } |
Private Member Functions | |
int | AddEntity (int parent, const char *type) |
void | AddMacro (const char *macroname, const char *entityname, int line, int starttoken, int endtoken) |
CProperty * | AddProperty (int entity, const char *name, int line) |
void | AddPropertyValue (CProperty *property, int index, int value_token) |
bool | AddToken (int type, const char *value, int include) |
void | ClearEntities () |
void | ClearMacros () |
void | ClearProperties () |
void | ClearTokens () |
void | DumpEntities () |
void | DumpMacros () |
void | DumpProperties () |
void | DumpTokens () |
const char * | GetTokenValue (int index) |
bool | LoadTokenComment (FILE *file, int *line, int include) |
bool | LoadTokenInclude (FILE *file, int *line, int include) |
bool | LoadTokenNum (FILE *file, int *line, int include) |
bool | LoadTokens (FILE *file, int include) |
bool | LoadTokenSpace (FILE *file, int *line, int include) |
bool | LoadTokenString (FILE *file, int *line, int include) |
bool | LoadTokenWord (FILE *file, int *line, int include) |
CMacro * | LookupMacro (const char *macroname) |
bool | ParseTokenDefine (int *index, int *line) |
bool | ParseTokenEntity (int entity, int *index, int *line) |
bool | ParseTokenInclude (int *index, int *line) |
bool | ParseTokenProperty (int entity, int *index, int *line) |
bool | ParseTokens () |
bool | ParseTokenTuple (CProperty *property, int *index, int *line) |
bool | ParseTokenWord (int entity, int *index, int *line) |
bool | SaveTokens (FILE *file) |
void | SetPropertyValue (CProperty *property, int index, const char *value) |
bool | SetTokenValue (int index, const char *value) |
Private Attributes | |
std::vector< CEntity > | entities |
std::map< std::string, CMacro > | macros |
std::map< std::string, CProperty * > | properties |
std::vector< CToken > | tokens |
Definition at line 69 of file worldfile.hh.
|
private |
Enumerator | |
---|---|
TokenComment | |
TokenWord | |
TokenNum | |
TokenString | |
TokenOpenEntity | |
TokenCloseEntity | |
TokenOpenTuple | |
TokenCloseTuple | |
TokenSpace | |
TokenEOL |
Definition at line 268 of file worldfile.hh.
Worldfile::Worldfile | ( | ) |
Definition at line 64 of file worldfile.cc.
Worldfile::~Worldfile | ( | ) |
Definition at line 78 of file worldfile.cc.
|
private |
Definition at line 1175 of file worldfile.cc.
|
private |
Definition at line 1114 of file worldfile.cc.
|
private |
Definition at line 1267 of file worldfile.cc.
|
private |
Definition at line 1282 of file worldfile.cc.
|
private |
Definition at line 689 of file worldfile.cc.
|
private |
Definition at line 1162 of file worldfile.cc.
|
private |
Definition at line 1106 of file worldfile.cc.
|
private |
Definition at line 1257 of file worldfile.cc.
|
private |
Definition at line 681 of file worldfile.cc.
|
private |
Definition at line 1244 of file worldfile.cc.
|
private |
Definition at line 1137 of file worldfile.cc.
|
private |
Definition at line 1355 of file worldfile.cc.
|
private |
Definition at line 717 of file worldfile.cc.
|
protected |
Definition at line 86 of file worldfile.cc.
int Worldfile::GetEntityCount | ( | ) |
Definition at line 1196 of file worldfile.cc.
int Worldfile::GetEntityParent | ( | int | entity | ) |
Definition at line 1204 of file worldfile.cc.
const char * Worldfile::GetEntityType | ( | int | entity | ) |
Definition at line 1214 of file worldfile.cc.
CProperty * Worldfile::GetProperty | ( | int | entity, |
const char * | name | ||
) |
Definition at line 1298 of file worldfile.cc.
const char * Worldfile::GetPropertyValue | ( | CProperty * | property, |
int | index | ||
) |
Definition at line 1345 of file worldfile.cc.
|
private |
Definition at line 708 of file worldfile.cc.
bool Worldfile::Load | ( | const std::string & | filename | ) |
Definition at line 125 of file worldfile.cc.
|
private |
Definition at line 341 of file worldfile.cc.
|
private |
Definition at line 420 of file worldfile.cc.
|
private |
Definition at line 550 of file worldfile.cc.
|
private |
Definition at line 244 of file worldfile.cc.
|
private |
Definition at line 623 of file worldfile.cc.
|
private |
Definition at line 586 of file worldfile.cc.
|
private |
Definition at line 374 of file worldfile.cc.
int Worldfile::LookupEntity | ( | const char * | type | ) |
Definition at line 1225 of file worldfile.cc.
|
private |
Definition at line 1124 of file worldfile.cc.
|
private |
Definition at line 826 of file worldfile.cc.
|
private |
Definition at line 939 of file worldfile.cc.
|
private |
Definition at line 795 of file worldfile.cc.
|
private |
Definition at line 1028 of file worldfile.cc.
|
private |
Definition at line 740 of file worldfile.cc.
|
private |
Definition at line 1069 of file worldfile.cc.
|
private |
Definition at line 903 of file worldfile.cc.
bool Worldfile::PropertyExists | ( | int | section, |
const char * | token | ||
) |
Definition at line 1324 of file worldfile.cc.
|
inline |
Definition at line 116 of file worldfile.hh.
uint32_t Stg::Worldfile::ReadColor | ( | int | entity, |
const char * | name, | ||
uint32_t | value | ||
) |
const char * Worldfile::ReadFilename | ( | int | entity, |
const char * | name, | ||
const char * | value | ||
) |
Definition at line 1450 of file worldfile.cc.
double Worldfile::ReadFloat | ( | int | entity, |
const char * | name, | ||
double | value | ||
) |
Definition at line 1434 of file worldfile.cc.
int Worldfile::ReadInt | ( | int | entity, |
const char * | name, | ||
int | value | ||
) |
Definition at line 1398 of file worldfile.cc.
|
inline |
Definition at line 107 of file worldfile.hh.
const std::string Worldfile::ReadString | ( | int | entity, |
const char * | name, | ||
const std::string & | value | ||
) |
Definition at line 1376 of file worldfile.cc.
int Worldfile::ReadTuple | ( | const int | entity, |
const char * | name, | ||
const unsigned int | first, | ||
const unsigned int | num, | ||
const char * | format, | ||
... | |||
) |
Definition at line 1506 of file worldfile.cc.
bool Worldfile::Save | ( | const std::string & | filename | ) |
Definition at line 193 of file worldfile.cc.
|
private |
Definition at line 659 of file worldfile.cc.
|
private |
Definition at line 1332 of file worldfile.cc.
|
private |
Definition at line 698 of file worldfile.cc.
bool Worldfile::WarnUnused | ( | ) |
Definition at line 224 of file worldfile.cc.
void Worldfile::WriteFloat | ( | int | entity, |
const char * | name, | ||
double | value | ||
) |
Definition at line 1418 of file worldfile.cc.
void Worldfile::WriteInt | ( | int | entity, |
const char * | name, | ||
int | value | ||
) |
Definition at line 1409 of file worldfile.cc.
void Stg::Worldfile::WriteLength | ( | int | entity, |
const char * | name, | ||
double | value | ||
) |
void Worldfile::WriteString | ( | int | entity, |
const char * | name, | ||
const std::string & | value | ||
) |
Definition at line 1387 of file worldfile.cc.
void Worldfile::WriteTuple | ( | const int | entity, |
const char * | name, | ||
const unsigned int | first, | ||
const unsigned int | count, | ||
const char * | format, | ||
... | |||
) |
Definition at line 1573 of file worldfile.cc.
|
private |
Definition at line 344 of file worldfile.hh.
std::string Stg::Worldfile::filename |
Definition at line 350 of file worldfile.hh.
|
private |
Definition at line 327 of file worldfile.hh.
|
private |
Definition at line 347 of file worldfile.hh.
|
private |
Definition at line 298 of file worldfile.hh.
double Stg::Worldfile::unit_angle |
Definition at line 354 of file worldfile.hh.
double Stg::Worldfile::unit_length |
Definition at line 353 of file worldfile.hh.