41 std::cout << std::endl <<
"ClassHeaderGenerator::RegisterName: Field at line " << row <<
": The name '" << name <<
"' is already used.";
64 const char* name = field->Attribute(
"name");
65 if (name ==
nullptr) {
66 std::cout << std::endl <<
"ClassHeaderGenerator::ProcessElementDef: <element> at line " << field->Row() <<
" contains more than one root element, skipping.";
70 const TiXmlElement*
main = field->FirstChildElement();
71 if (main->NextSiblingElement() !=
nullptr) {
72 std::cout << std::endl <<
"ClassHeaderGenerator::ProcessElementDef: <element> at line " << field->Row() <<
" contains more than one root element, skipping.";
82 " %s(const %s& oth);\n"
85 " void Dump(LogType type, const char* pfx = \" \") const;\n"
87 " bool Decode(PyRep* packet);\n"
88 " bool Decode(PyRep** packet);\n"
89 " bool Decode(%s** packet);\n"
90 " %s* Encode() const;\n"
92 " %s& operator=(const %s& oth);\n"
121 const char* name = field->Attribute(
"name" );
122 if (name ==
nullptr) {
123 std::cout << std::endl <<
"ClassHeaderGenerator::ProcessElement: field at line " << field->Row() <<
" is missing the name attribute, skipping.";
126 const char* type = field->Attribute(
"type" );
127 if (type ==
nullptr) {
128 std::cout << std::endl <<
"ClassHeaderGenerator::ProcessElement: field at line " << field->Row() <<
" is missing the type attribute, skipping.";
145 const char* name = field->Attribute(
"name" );
146 if (name ==
nullptr) {
147 std::cout << std::endl <<
"ClassHeaderGenerator::ProcessElementPtr: field at line " << field->Row() <<
" is missing the name attribute, skipping.";
150 const char* type = field->Attribute(
"type" );
151 if (type ==
nullptr) {
152 std::cout << std::endl <<
"ClassHeaderGenerator::ProcessElementPtr: field at line " << field->Row() <<
" is missing the type attribute, skipping.";
169 const char* name = field->Attribute(
"name" );
170 if (name ==
nullptr) {
171 std::cout << std::endl <<
"ClassHeaderGenerator::ProcessRaw: field at line " << field->Row() <<
" is missing the name attribute, skipping.";
188 const char* name = field->Attribute(
"name" );
189 if (name ==
nullptr) {
190 std::cout << std::endl <<
"ClassHeaderGenerator::ProcessInt: field at line " << field->Row() <<
" is missing the name attribute, skipping.";
207 const char* name = field->Attribute(
"name" );
208 if (name ==
nullptr) {
209 std::cout << std::endl <<
"ClassHeaderGenerator::ProcessLong: field at line " << field->Row() <<
" is missing the name attribute, skipping.";
226 const char* name = field->Attribute(
"name" );
227 if (name ==
nullptr) {
228 std::cout << std::endl <<
"ClassHeaderGenerator::ProcessReal: field at line " << field->Row() <<
" is missing the name attribute, skipping.";
245 const char* name = field->Attribute(
"name" );
246 if (name ==
nullptr) {
247 std::cout << std::endl <<
"ClassHeaderGenerator::ProcessBool: field at line " << field->Row() <<
" is missing the name attribute, skipping.";
269 const char* name = field->Attribute(
"name" );
270 if (name ==
nullptr) {
271 std::cout << std::endl <<
"ClassHeaderGenerator::ProcessBuffer: field at line " << field->Row() <<
" is missing the name attribute, skipping.";
288 const char* name = field->Attribute(
"name" );
289 if (name ==
nullptr) {
290 std::cout << std::endl <<
"ClassHeaderGenerator::ProcessString: field at line " << field->Row() <<
" is missing the name attribute, skipping.";
298 " std::string\t\t%s;\n",
312 const char* name = field->Attribute(
"name" );
313 if (name ==
nullptr) {
314 std::cout << std::endl <<
"ClassHeaderGenerator::ProcessWString: field at line " << field->Row() <<
" is missing the name attribute, skipping.";
322 " std::string\t\t%s;\n",
336 const char* name = field->Attribute(
"name" );
337 if (name ==
nullptr) {
338 std::cout << std::endl <<
"ClassHeaderGenerator::ProcessToken: field at line " << field->Row() <<
" is missing the name attribute, skipping.";
346 " PyToken*\t\t%s;\n",
360 const char* name = field->Attribute(
"name" );
361 if (name ==
nullptr) {
362 std::cout << std::endl <<
"ClassHeaderGenerator::ProcessObject: field at line " << field->Row() <<
" is missing the name attribute, skipping.";
381 const char* name = field->Attribute(
"name" );
382 if (name ==
nullptr) {
383 std::cout << std::endl <<
"ClassHeaderGenerator::ProcessObjectEx: field at line " << field->Row() <<
" is missing the name attribute, skipping.";
386 const char* type = field->Attribute(
"type" );
387 if (type ==
nullptr) {
388 std::cout << std::endl <<
"ClassHeaderGenerator::ProcessObjectEx: field at line " << field->Row() <<
" is missing the type attribute, skipping.";
405 const char* name = field->Attribute(
"name" );
406 if (name ==
nullptr) {
407 std::cout << std::endl <<
"ClassHeaderGenerator::ProcessTuple: field at line " << field->Row() <<
" is missing the name attribute, skipping.";
415 " PyTuple*\t\t%s;\n",
429 const char* name = field->Attribute(
"name" );
430 if (name ==
nullptr) {
431 std::cout << std::endl <<
"ClassHeaderGenerator::ProcessList: field at line " << field->Row() <<
" is missing the name attribute, skipping.";
453 const char* name = field->Attribute(
"name" );
454 if (name ==
nullptr) {
455 std::cout << std::endl <<
"ClassHeaderGenerator::ProcessListInt: field at line " << field->Row() <<
" is missing the name attribute, skipping.";
463 " std::vector<int32>\t%s;\n",
472 const char* name = field->Attribute(
"name" );
473 if (name ==
nullptr) {
474 std::cout << std::endl <<
"ClassHeaderGenerator::ProcessListLong: field at line " << field->Row() <<
" is missing the name attribute, skipping.";
482 " std::vector<int64>\t%s;\n",
491 const char* name = field->Attribute(
"name" );
492 if (name ==
nullptr) {
493 std::cout << std::endl <<
"ClassHeaderGenerator::ProcessListStr: field at line " << field->Row() <<
" is missing the name attribute, skipping.";
501 " std::vector<std::string>\t%s;\n",
510 const char* name = field->Attribute(
"name" );
511 if (name ==
nullptr) {
512 std::cout << std::endl <<
"ClassHeaderGenerator::ProcessDict: field at line " << field->Row() <<
" is missing the name attribute, skipping.";
535 const char*
key = field->Attribute(
"key" );
537 std::cout << std::endl <<
"ClassHeaderGenerator::ProcessDictInlineEntry: field at line " << field->Row() <<
" is missing the key attribute, skipping.";
546 const char* name = field->Attribute(
"name" );
547 if (name ==
nullptr) {
548 std::cout << std::endl <<
"ClassHeaderGenerator::ProcessDictRaw: field at line " << field->Row() <<
" is missing the name attribute, skipping.";
552 const char*
key = field->Attribute(
"key" );
553 if (key ==
nullptr) {
554 std::cout << std::endl <<
"ClassHeaderGenerator::ProcessDictRaw: field at line " << field->Row() <<
" is missing the key attribute, skipping.";
557 const char* pykey = field->Attribute(
"pykey" );
558 if (pykey ==
nullptr) {
559 std::cout << std::endl <<
"ClassHeaderGenerator::ProcessDictRaw: field at line " << field->Row() <<
" is missing the pykey attribute, skipping.";
562 const char* value = field->Attribute(
"value" );
563 if (value ==
nullptr) {
564 std::cout << std::endl <<
"ClassHeaderGenerator::ProcessDictRaw: field at line " << field->Row() <<
" is missing the value attribute, skipping.";
567 const char* pyvalue = field->Attribute(
"pyvalue" );
568 if (pyvalue ==
nullptr) {
569 std::cout << std::endl <<
"ClassHeaderGenerator::ProcessDictRaw: field at line " << field->Row() <<
" is missing the pyvalue attribute, skipping.";
577 " std::map<%s, %s>\t%s;\n",
586 const char* name = field->Attribute(
"name" );
587 if (name ==
nullptr) {
588 std::cout << std::endl <<
"ClassHeaderGenerator::ProcessDictInt: field at line " << field->Row() <<
" is missing the name attribute, skipping.";
596 " std::map<int32, PyRep*>\t%s;\n",
605 const char* name = field->Attribute(
"name" );
606 if (name ==
nullptr) {
607 std::cout << std::endl <<
"ClassHeaderGenerator::ProcessDictStr: field at line " << field->Row() <<
" is missing the name attribute, skipping.";
615 " std::map<std::string, PyRep*>\t%s;\n",
bool ParseElement(const TiXmlElement *element) const
Parses element using registered parsers.
void RegisterProcessors()
static const char * GetEncodeType(const TiXmlElement *element)
Obtains encode type of given element.
int main(int argc, char *argv[])
Generic class for eve-xmlpktgen's generators.
bool ParseElementChildren(const TiXmlElement *element, size_t max=0) const
Parses element's children using registered parsers.
typeID Spawn an NPC with the specified type text Search for items matching the specified query() type() key(value)-Send an OnRemoteMessage" ) COMMAND( setbpattr
void AddMemberParser(const char *name, T &instance, bool(T::*method)(const TiXmlElement *))
Adds a member parser.