EvEmu  0.8.4
11 September 2021
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
PyLookupDump.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 __PYLOOKUPDUMP_H_INCL__
27 #define __PYLOOKUPDUMP_H_INCL__
28 
29 #include "python/PyDumpVisitor.h"
30 
32 {
33 public:
34  bool LoadIntFile(const char *file);
35  bool LoadStringFile(const char *file);
36 
37  const char *LookupInt(int64 value) const;
38  const char *LookupString(const char *value) const;
39 
40 protected:
41  std::map<uint32, std::string> m_intRecords;
42  std::map<std::string, std::string> m_strRecords;
43  mutable std::string m_dateBuffer; //not thread safe or reentrant...
44 };
45 
47 {
48 public:
49  PyLookupDumpVisitor( PyLookupResolver* _resolver, LogType log_type, LogType log_hex_type, const char* pfx = "", bool full_nested = false, bool full_hex = false );
50 
51  PyLookupResolver* resolver() const { return mResolver; }
52 
53 protected:
54  bool VisitInteger( const PyInt* rep );
55  bool VisitString( const PyString* rep );
56 
57 private:
59 };
60 
61 #endif
Python string.
Definition: PyRep.h:430
PyLookupResolver *const mResolver
Definition: PyLookupDump.h:58
std::map< std::string, std::string > m_strRecords
Definition: PyLookupDump.h:42
std::map< uint32, std::string > m_intRecords
Definition: PyLookupDump.h:41
PyLookupResolver * resolver() const
Definition: PyLookupDump.h:51
Python integer.
Definition: PyRep.h:231
const char * LookupString(const char *value) const
signed __int64 int64
Definition: eve-compat.h:51
LogType
Definition: logsys.h:59
bool VisitInteger(const PyInt *rep)
primitive data visitors
const char * LookupInt(int64 value) const
bool VisitString(const PyString *rep)
bool LoadIntFile(const char *file)
std::string m_dateBuffer
Definition: PyLookupDump.h:43
bool LoadStringFile(const char *file)
PyLookupDumpVisitor(PyLookupResolver *_resolver, LogType log_type, LogType log_hex_type, const char *pfx="", bool full_nested=false, bool full_hex=false)