EvEmu  0.8.4
11 September 2021
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
XMLPacketGen.h
Go to the documentation of this file.
1 /*
2  ------------------------------------------------------------------------------------
3  LICENSE:
4  ------------------------------------------------------------------------------------
5  This file is part of EVEmu: EVE Online Server Emulator
6  Copyright 2006 - 2021 The EVEmu Team
7  For the latest information visit https://evemu.dev
8  ------------------------------------------------------------------------------------
9  This program is free software; you can redistribute it and/or modify it under
10  the terms of the GNU Lesser General Public License as published by the Free Software
11  Foundation; either version 2 of the License, or (at your option) any later
12  version.
13 
14  This program is distributed in the hope that it will be useful, but WITHOUT
15  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16  FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
17 
18  You should have received a copy of the GNU Lesser General Public License along with
19  this program; if not, write to the Free Software Foundation, Inc., 59 Temple
20  Place - Suite 330, Boston, MA 02111-1307, USA, or go to
21  http://www.gnu.org/copyleft/lesser.txt.
22  ------------------------------------------------------------------------------------
23  Author: Zhur
24 */
25 
26 #ifndef __XMLPACKETGEN_H_INCL__
27 #define __XMLPACKETGEN_H_INCL__
28 
29 #include "HeaderGenerator.h"
30 #include "ConstructGenerator.h"
31 #include "DestructGenerator.h"
32 #include "DumpGenerator.h"
33 #include "EncodeGenerator.h"
34 #include "DecodeGenerator.h"
35 #include "CloneGenerator.h"
36 #include "utils/XMLParserEx.h"
37 
46 : public XMLParserEx
47 {
48 public:
55  XMLPacketGen( const char* header = "", const char* source = "" );
59  ~XMLPacketGen();
60 
66  void SetHeaderFile( const char* header );
67 
73  void SetSourceFile( const char* source );
74 
75 protected:
76  bool ParseElements( const TiXmlElement* field );
77  bool ParseInclude( const TiXmlElement* field );
78  bool ParseElementDef( const TiXmlElement* field );
79 
80 private:
87  bool OpenFiles();
88 
89  FILE* mHeaderFile;
90  std::string mHeaderFileName;
91  FILE* mSourceFile;
92  std::string mSourceFileName;
93 
101 
102  static std::string FNameToDef( const char* buf );
103 
104  static const char* const smGenFileComment;
105 };
106 
107 #endif//__XMLPACKETGEN_H_INCL__
static const char *const smGenFileComment
Definition: XMLPacketGen.h:104
bool ParseElementDef(const TiXmlElement *field)
bool ParseInclude(const TiXmlElement *field)
FILE * mSourceFile
Definition: XMLPacketGen.h:91
ClassCloneGenerator mClone
Definition: XMLPacketGen.h:94
std::string mHeaderFileName
Definition: XMLPacketGen.h:90
ClassDumpGenerator mDump
Definition: XMLPacketGen.h:98
ClassConstructGenerator mConstruct
Definition: XMLPacketGen.h:95
static std::string FNameToDef(const char *buf)
A somewhat extended version of XMLParser.
Definition: XMLParserEx.h:37
ClassDecodeGenerator mDecode
Definition: XMLPacketGen.h:96
void SetHeaderFile(const char *header)
Sets header file.
XMLPacketGen(const char *header="", const char *source="")
Primary constructor.
ClassDestructGenerator mDestruct
Definition: XMLPacketGen.h:97
ClassHeaderGenerator mHeader
Definition: XMLPacketGen.h:100
bool OpenFiles()
Opens output files.
void SetSourceFile(const char *source)
Sets source file.
ClassEncodeGenerator mEncode
Definition: XMLPacketGen.h:99
std::string mSourceFileName
Definition: XMLPacketGen.h:92
XML Packet Generator class.
Definition: XMLPacketGen.h:45
~XMLPacketGen()
Destructory; closes output files.
FILE * mHeaderFile
Definition: XMLPacketGen.h:89
bool ParseElements(const TiXmlElement *field)