44 const char* name = field->Attribute(
"name" );
45 if (name ==
nullptr) {
46 std::cout << std::endl <<
"ClassCloneGenerator:: <element> at line " << field->Row() <<
" is missing the name attribute, skipping.";
51 "%s& %s::operator=( const %s& oth )\n"
70 const char* name = field->Attribute(
"name" );
71 if (name ==
nullptr) {
72 std::cout << std::endl <<
"ClassCloneGenerator::ProcessElement field at line " << field->Row() <<
" is missing the name attribute, skipping.";
75 const char* type = field->Attribute(
"type" );
76 if (type ==
nullptr) {
77 std::cout << std::endl <<
"ClassCloneGenerator::ProcessElement field at line " << field->Row() <<
" is missing the type attribute, skipping.";
92 const char* name = field->Attribute(
"name" );
93 if (name ==
nullptr) {
94 std::cout << std::endl <<
"ClassCloneGenerator::ProcessElementPtr field at line " << field->Row() <<
" is missing the name attribute, skipping.";
97 const char* type = field->Attribute(
"type" );
98 if (type ==
nullptr) {
99 std::cout << std::endl <<
"ClassCloneGenerator::ProcessElementPtr field at line " << field->Row() <<
" is missing the type attribute, skipping.";
105 " if (oth.%s == nullptr) {\n"
107 " _log(NET__PACKET_WARNING, \"oth.%s is null. %s = nullptr \");\n"
109 " %s = new %s(*oth.%s);\n"
123 const char* name = field->Attribute(
"name" );
124 if (name ==
nullptr) {
125 std::cout << std::endl <<
"ClassCloneGenerator::ProcessRaw field at line " << field->Row() <<
" is missing the name attribute, skipping.";
130 " PySafeDecRef(%s);\n"
131 " if (oth.%s == nullptr) {\n"
133 " _log(NET__PACKET_WARNING, \"oth.%s is null. %s = nullptr \");\n"
135 " %s = oth.%s->Clone();\n"
149 const char* name = field->Attribute(
"name" );
150 if (name ==
nullptr) {
151 std::cout << std::endl <<
"ClassCloneGenerator::ProcessInt field at line " << field->Row() <<
" is missing the name attribute, skipping.";
166 const char* name = field->Attribute(
"name" );
167 if (name ==
nullptr) {
168 std::cout << std::endl <<
"ClassCloneGenerator::ProcessLong field at line " << field->Row() <<
" is missing the name attribute, skipping.";
183 const char* name = field->Attribute(
"name" );
184 if (name ==
nullptr) {
185 std::cout << std::endl <<
"ClassCloneGenerator::ProcessReal field at line " << field->Row() <<
" is missing the name attribute, skipping.";
200 const char* name = field->Attribute(
"name" );
201 if (name ==
nullptr) {
202 std::cout << std::endl <<
"ClassCloneGenerator::ProcessBool field at line " << field->Row() <<
" is missing the name attribute, skipping.";
222 const char* name = field->Attribute(
"name" );
223 if (name ==
nullptr) {
224 std::cout << std::endl <<
"ClassCloneGenerator::ProcessBuffer field at line " << field->Row() <<
" is missing the name attribute, skipping.";
229 " PySafeDecRef(%s);\n"
230 " if (oth.%s == nullptr) {\n"
232 " _log(NET__PACKET_WARNING, \"oth.%s is null. %s = nullptr \");\n"
234 " %s = new PyBuffer(*oth.%s);\n"
248 const char* name = field->Attribute(
"name" );
249 if (name ==
nullptr) {
250 std::cout << std::endl <<
"ClassCloneGenerator::ProcessString field at line " << field->Row() <<
" is missing the name attribute, skipping.";
270 const char* name = field->Attribute(
"name" );
271 if (name ==
nullptr) {
272 std::cout << std::endl <<
"ClassCloneGenerator::ProcessWString field at line " << field->Row() <<
" is missing the name attribute, skipping.";
292 const char* name = field->Attribute(
"name" );
293 if (name ==
nullptr) {
294 std::cout << std::endl <<
"ClassCloneGenerator::ProcessToken field at line " << field->Row() <<
" is missing the name attribute, skipping.";
299 " PySafeDecRef(%s);\n"
300 " if (oth.%s == nullptr) {\n"
302 " _log(NET__PACKET_WARNING, \"oth.%s is null. %s = nullptr \");\n"
304 " %s = oth.%s->Clone();\n"
323 const char* name = field->Attribute(
"name" );
324 if (name ==
nullptr) {
325 std::cout << std::endl <<
"ClassCloneGenerator::ProcessObject field at line " << field->Row() <<
" is missing the name attribute, skipping.";
330 " PySafeDecRef(%s);\n"
331 " if (oth.%s == nullptr) {\n"
333 " _log(NET__PACKET_WARNING, \"oth.%s is null. %s = nullptr \");\n"
335 " %s = new PyObject(*oth.%s);\n"
354 const char* name = field->Attribute(
"name" );
355 if (name ==
nullptr) {
356 std::cout << std::endl <<
"ClassCloneGenerator::ProcessObjectEx field at line " << field->Row() <<
" is missing the name attribute, skipping.";
359 const char* type = field->Attribute(
"type" );
360 if (type ==
nullptr) {
361 std::cout << std::endl <<
"ClassCloneGenerator::ProcessObjectEx field at line " << field->Row() <<
" is missing the type attribute, skipping.";
366 " PySafeDecRef(%s);\n"
367 " if (oth.%s == nullptr) {\n"
369 " _log(NET__PACKET_WARNING, \"oth.%s is null. %s = nullptr \");\n"
371 " %s = new %s(*oth.%s);\n",
384 const char* name = field->Attribute(
"name" );
385 if (name ==
nullptr) {
386 std::cout << std::endl <<
"ClassCloneGenerator::ProcessTuple field at line " << field->Row() <<
" is missing the name attribute, skipping.";
391 " PySafeDecRef(%s);\n"
392 " if (oth.%s == nullptr) {\n"
394 " _log(NET__PACKET_WARNING, \"oth.%s is null. %s = nullptr \");\n"
396 " %s = new PyTuple(*oth.%s);\n"
415 const char* name = field->Attribute(
"name" );
416 if (name ==
nullptr) {
417 std::cout << std::endl <<
"ClassCloneGenerator::ProcessList field at line " << field->Row() <<
" is missing the name attribute, skipping.";
422 " PySafeDecRef(%s);\n"
423 " if (oth.%s == nullptr) {\n"
425 " _log(NET__PACKET_WARNING, \"oth.%s is null. %s = nullptr \");\n"
427 " %s = new PyList(*oth.%s);\n"
446 const char* name = field->Attribute(
"name" );
447 if (name ==
nullptr) {
448 std::cout << std::endl <<
"ClassCloneGenerator::ProcessListInt field at line " << field->Row() <<
" is missing the name attribute, skipping.";
463 const char* name = field->Attribute(
"name" );
464 if (name ==
nullptr) {
465 std::cout << std::endl <<
"ClassCloneGenerator::ProcessListLong field at line " << field->Row() <<
" is missing the name attribute, skipping.";
480 const char* name = field->Attribute(
"name" );
481 if (name ==
nullptr) {
482 std::cout << std::endl <<
"ClassCloneGenerator::ProcessListStr field at line " << field->Row() <<
" is missing the name attribute, skipping.";
497 const char* name = field->Attribute(
"name" );
498 if (name ==
nullptr) {
499 std::cout << std::endl <<
"ClassCloneGenerator::ProcessDict field at line " << field->Row() <<
" is missing the name attribute, skipping.";
504 " PySafeDecRef(%s);\n"
505 " if (oth.%s == nullptr) {\n"
507 " _log(NET__PACKET_WARNING, \"oth.%s is null. %s = nullptr \");\n"
509 " %s = new PyDict(*oth.%s);\n"
530 const char*
key = field->Attribute(
"key" );
531 if (key ==
nullptr) {
532 std::cout << std::endl <<
"ClassCloneGenerator::ProcessDictInlineEntry <dictInlineEntry> at line " << field->Row() <<
" is missing the key attribute, skipping.";
541 const char* name = field->Attribute(
"name" );
542 if (name ==
nullptr) {
543 std::cout << std::endl <<
"ClassCloneGenerator::ProcessDictRaw field at line " << field->Row() <<
" is missing the name attribute, skipping.";
558 const char* name = field->Attribute(
"name" );
560 if (name ==
nullptr) {
561 std::cout << std::endl <<
"ClassCloneGenerator::ProcessDictInt field at line " << field->Row() <<
" is missing the name attribute, skipping.";
566 " std::map<int32, PyRep*>::const_iterator %s_cur = %s.begin();\n"
567 " //free any existing elements first\n"
568 " for (; %s_cur != %s.end(); %s_cur++)\n"
569 " PyDecRef( %s_cur->second );\n"
572 " //now we can copy in the new ones...\n"
573 " for (%s_cur = oth.%s.begin(); %s_cur != oth.%s.end(); %s_cur++)\n"
574 " %s[ %s_cur->first ] = %s_cur->second->Clone();\n"
580 name, name, name, name, name,
589 const char* name = field->Attribute(
"name" );
590 if (name ==
nullptr) {
591 std::cout << std::endl <<
"ClassCloneGenerator::ProcessDictStr field at line " << field->Row() <<
" is missing the name attribute, skipping.";
596 " std::map<std::string, PyRep*>::const_iterator %s_cur = %s.begin();\n"
597 " //free any existing elements first\n"
598 " for (; %s_cur != %s.end(); %s_cur++)\n"
599 " PyDecRef( %s_cur->second );\n"
602 " //now we can copy in the new ones...\n"
603 " for (%s_cur = oth.%s.begin(); %s_cur != oth.%s.end(); %s_cur++)\n"
604 " %s[ %s_cur->first ] = %s_cur->second->Clone();\n"
610 name, name, name, name, name,
bool ProcessTupleInline(const TiXmlElement *field)
bool ProcessListLong(const TiXmlElement *field)
bool ProcessDictStr(const TiXmlElement *field)
bool ProcessTokenInline(const TiXmlElement *field)
void RegisterProcessors()
bool ProcessListInline(const TiXmlElement *field)
bool ProcessList(const TiXmlElement *field)
bool ProcessDictInlineEntry(const TiXmlElement *field)
bool ProcessReal(const TiXmlElement *field)
bool ProcessNone(const TiXmlElement *field)
bool ProcessListStr(const TiXmlElement *field)
bool ProcessBool(const TiXmlElement *field)
bool ProcessDict(const TiXmlElement *field)
bool ProcessStringInline(const TiXmlElement *field)
bool ProcessBuffer(const TiXmlElement *field)
bool ProcessString(const TiXmlElement *field)
bool ProcessToken(const TiXmlElement *field)
bool ProcessElement(const TiXmlElement *field)
bool ProcessInt(const TiXmlElement *field)
bool ProcessObjectEx(const TiXmlElement *field)
void RegisterProcessors()
bool ProcessObjectInline(const TiXmlElement *field)
bool ProcessLong(const TiXmlElement *field)
bool ProcessRaw(const TiXmlElement *field)
bool ProcessObject(const TiXmlElement *field)
bool ProcessElementDef(const TiXmlElement *field)
bool ProcessDictInline(const TiXmlElement *field)
bool ProcessDictRaw(const TiXmlElement *field)
ClassCloneGenerator(FILE *outputFile=NULL)
Generic class for eve-xmlpktgen's generators.
bool ParseElementChildren(const TiXmlElement *element, size_t max=0) const
Parses element's children using registered parsers.
bool ProcessTuple(const TiXmlElement *field)
typeID Spawn an NPC with the specified type text Search for items matching the specified query() type() key(value)-Send an OnRemoteMessage" ) COMMAND( setbpattr
bool ProcessSubStructInline(const TiXmlElement *field)
bool ProcessWString(const TiXmlElement *field)
bool ProcessElementPtr(const TiXmlElement *field)
bool ProcessWStringInline(const TiXmlElement *field)
bool ProcessDictInt(const TiXmlElement *field)
bool ProcessSubStreamInline(const TiXmlElement *field)
bool ProcessListInt(const TiXmlElement *field)
void AddMemberParser(const char *name, T &instance, bool(T::*method)(const TiXmlElement *))
Adds a member parser.