EvEmu
0.8.4
11 September 2021
|
XML Packet Generator class. More...
#include "XMLPacketGen.h"
Public Member Functions | |
XMLPacketGen (const char *header="", const char *source="") | |
Primary constructor. More... | |
~XMLPacketGen () | |
Destructory; closes output files. More... | |
void | SetHeaderFile (const char *header) |
Sets header file. More... | |
void | SetSourceFile (const char *source) |
Sets source file. More... | |
![]() | |
template<typename T > | |
void | AddMemberParser (const char *name, T &instance, bool(T::*method)(const TiXmlElement *)) |
Adds a member parser. More... | |
template<typename T > | |
void | AddValueParser (const char *name, T &value) |
Adds a value parser. More... | |
![]() | |
XMLParser () | |
Primary constructor. More... | |
virtual | ~XMLParser () |
A destructor. More... | |
bool | ParseFile (const char *file) |
Parses file using registered parsers. More... | |
bool | ParseElement (const TiXmlElement *element) const |
Parses element using registered parsers. More... | |
bool | ParseElementChildren (const TiXmlElement *element, size_t max=0) const |
Parses element's children using registered parsers. More... | |
void | AddParser (const char *name, ElementParser *parser) |
Adds a parser. More... | |
void | RemoveParser (const char *name) |
Removes a parser. More... | |
void | ClearParsers () |
Clears all parsers. More... | |
Protected Member Functions | |
bool | ParseElements (const TiXmlElement *field) |
bool | ParseInclude (const TiXmlElement *field) |
bool | ParseElementDef (const TiXmlElement *field) |
![]() | |
template<typename T > | |
void | AddMemberParser (const char *name, bool(T::*method)(const TiXmlElement *)) |
Adds a member parser, assuming that instance is this. More... | |
Private Member Functions | |
bool | OpenFiles () |
Opens output files. More... | |
Static Private Member Functions | |
static std::string | FNameToDef (const char *buf) |
Private Attributes | |
FILE * | mHeaderFile |
std::string | mHeaderFileName |
FILE * | mSourceFile |
std::string | mSourceFileName |
ClassCloneGenerator | mClone |
ClassConstructGenerator | mConstruct |
ClassDecodeGenerator | mDecode |
ClassDestructGenerator | mDestruct |
ClassDumpGenerator | mDump |
ClassEncodeGenerator | mEncode |
ClassHeaderGenerator | mHeader |
Static Private Attributes | |
static const char *const | smGenFileComment |
Additional Inherited Members | |
![]() | |
std::unique_ptr< TiXmlDocument > | m_pXML_Document |
XML Packet Generator class.
Top-level class, controls the generation.
Definition at line 45 of file XMLPacketGen.h.
XMLPacketGen::XMLPacketGen | ( | const char * | header = "" , |
const char * | source = "" |
||
) |
Primary constructor.
[in] | header | Header file to be generated. |
[in] | source | Source file to be generated. |
Definition at line 62 of file XMLPacketGen.cpp.
References XMLParserEx::AddMemberParser(), ParseElementDef(), ParseElements(), and ParseInclude().
XMLPacketGen::~XMLPacketGen | ( | ) |
Destructory; closes output files.
Definition at line 73 of file XMLPacketGen.cpp.
References SetHeaderFile(), and SetSourceFile().
|
staticprivate |
Definition at line 235 of file XMLPacketGen.cpp.
References IsPrintable().
Referenced by ParseElements().
|
private |
Opens output files.
true | Open succeeded. |
false | Open failed. |
Definition at line 197 of file XMLPacketGen.cpp.
References mClone, mConstruct, mDecode, mDestruct, mDump, mEncode, mHeader, mHeaderFile, mHeaderFileName, mSourceFile, mSourceFileName, and Generator::SetOutputFile().
Referenced by ParseElements().
|
protected |
Definition at line 145 of file XMLPacketGen.cpp.
References mClone, mConstruct, mDecode, mDestruct, mDump, mEncode, mHeader, and XMLParser::ParseElement().
Referenced by XMLPacketGen().
|
protected |
Definition at line 80 of file XMLPacketGen.cpp.
References FNameToDef(), mHeaderFile, mHeaderFileName, mSourceFile, OpenFiles(), XMLParser::ParseElementChildren(), sLog, and smGenFileComment.
Referenced by XMLPacketGen().
|
protected |
Definition at line 128 of file XMLPacketGen.cpp.
References _log, and mHeaderFile.
Referenced by XMLPacketGen().
void XMLPacketGen::SetHeaderFile | ( | const char * | header | ) |
Sets header file.
[in] | header | Header file to be generated. |
Definition at line 158 of file XMLPacketGen.cpp.
References mHeader, mHeaderFile, mHeaderFileName, and Generator::SetOutputFile().
Referenced by main(), and ~XMLPacketGen().
void XMLPacketGen::SetSourceFile | ( | const char * | source | ) |
Sets source file.
[in] | source | Source file to be generated. |
Definition at line 175 of file XMLPacketGen.cpp.
References mClone, mConstruct, mDecode, mDestruct, mDump, mEncode, mSourceFile, mSourceFileName, and Generator::SetOutputFile().
Referenced by main(), and ~XMLPacketGen().
|
private |
Definition at line 94 of file XMLPacketGen.h.
Referenced by OpenFiles(), ParseElementDef(), and SetSourceFile().
|
private |
Definition at line 95 of file XMLPacketGen.h.
Referenced by OpenFiles(), ParseElementDef(), and SetSourceFile().
|
private |
Definition at line 96 of file XMLPacketGen.h.
Referenced by OpenFiles(), ParseElementDef(), and SetSourceFile().
|
private |
Definition at line 97 of file XMLPacketGen.h.
Referenced by OpenFiles(), ParseElementDef(), and SetSourceFile().
|
private |
Definition at line 98 of file XMLPacketGen.h.
Referenced by OpenFiles(), ParseElementDef(), and SetSourceFile().
|
private |
Definition at line 99 of file XMLPacketGen.h.
Referenced by OpenFiles(), ParseElementDef(), and SetSourceFile().
|
private |
Definition at line 100 of file XMLPacketGen.h.
Referenced by OpenFiles(), ParseElementDef(), and SetHeaderFile().
|
private |
Definition at line 89 of file XMLPacketGen.h.
Referenced by OpenFiles(), ParseElements(), ParseInclude(), and SetHeaderFile().
|
private |
Definition at line 90 of file XMLPacketGen.h.
Referenced by OpenFiles(), ParseElements(), and SetHeaderFile().
|
private |
Definition at line 91 of file XMLPacketGen.h.
Referenced by OpenFiles(), ParseElements(), and SetSourceFile().
|
private |
Definition at line 92 of file XMLPacketGen.h.
Referenced by OpenFiles(), and SetSourceFile().
|
staticprivate |
Definition at line 104 of file XMLPacketGen.h.
Referenced by ParseElements().