EvEmu  0.8.4
11 September 2021
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
EVEDBUtils.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 __EVEDBUTILS_H_INCL__
27 #define __EVEDBUTILS_H_INCL__
28 
29 #include "database/dbcore.h"
30 #include "network/packet_types.h"
31 
32 class PyRep;
33 class PyObject;
34 class PyTuple;
35 class PyList;
36 class PyDict;
37 class PyObjectEx;
38 class PyPackedRow;
39 class DBRowDescriptor;
40 
41 
42 void DBResultToIntIntDict(DBQueryResult &result, std::map<int32, int32> &into);
43 void DBResultToUIntUIntDict(DBQueryResult &result, std::map<uint32, uint32> &into);
44 void DBResultToIntIntlistDict(DBQueryResult &result, std::map<int32, PyRep *> &into);
45 
46 PyRep *DBColumnToPyRep(const DBResultRow &row, uint32 column_index);
47 
48 // this returns a std PyObject "util.Rowset" with data in 'lines'
50 PyObject *DBResultToIndexRowset(DBQueryResult &result, const char *key);
52 
54 // 2 lists, 1-colNames, 2-PyObject "util.Row" with data in 'lines'
55 PyTuple *DBResultToRowList(DBQueryResult &result, const char *type = "util.Row");
57 
58 PyDict *DBResultToIntRowDict(DBQueryResult &result, uint32 key_index, const char *type = "util.Row");
60 PyDict *DBResultToPackedRowDict(DBQueryResult &result, const char *key);
62 
64 
65 // this fills PyObjectEx2(util.KeyVal)'s 'list" with PacketRow objects
67 // this fills PyObjectEx2(util.KeyVal)'s 'list" with Indexed PacketRow objects
70 
71 //single rows:
73 PyObject *DBRowToRow(DBResultRow &row, const char *type = "util.Row");
75 
77 
78 #endif
79 
80 
81 
82 
PyTuple * DBResultToTupleSet(DBQueryResult &result)
Definition: EVEDBUtils.cpp:116
PyObject * DBRowToKeyVal(DBResultRow &row)
Definition: EVEDBUtils.cpp:199
Base Python wire object.
Definition: PyRep.h:66
PyObject * DBResultToIndexRowset(DBQueryResult &result, const char *key)
Definition: EVEDBUtils.cpp:144
PyRep * DBColumnToPyRep(const DBResultRow &row, uint32 column_index)
Definition: EVEDBUtils.cpp:36
Python's dictionary.
Definition: PyRep.h:719
void DBResultToUIntUIntDict(DBQueryResult &result, std::map< uint32, uint32 > &into)
Definition: EVEDBUtils.cpp:479
PyDict * DBResultToIntRowDict(DBQueryResult &result, uint32 key_index, const char *type="util.Row")
Definition: EVEDBUtils.cpp:257
PyDict * DBResultToPackedRowDict(DBQueryResult &result, const char *key)
Definition: EVEDBUtils.cpp:340
PyList * DBResultToPackedRowList(DBQueryResult &result)
Definition: EVEDBUtils.cpp:306
Python tuple.
Definition: PyRep.h:567
Python extended object.
Definition: PyRep.h:861
Python object.
Definition: PyRep.h:826
Python object "blue.DBRowDescriptor".
Definition: PyDatabase.h:41
PyPackedRow * CreatePackedRow(const DBResultRow &row, DBRowDescriptor *header)
Definition: EVEDBUtils.cpp:299
PyObject * DBRowToRow(DBResultRow &row, const char *type="util.Row")
Definition: EVEDBUtils.cpp:208
PyTuple * DBResultToPackedRowListTuple(DBQueryResult &result)
Definition: EVEDBUtils.cpp:322
unsigned __int32 uint32
Definition: eve-compat.h:50
PyObject * DBResultToRowset(DBQueryResult &result)
Definition: EVEDBUtils.cpp:81
PyRep * header() const
Definition: PyRep.h:886
PyTuple * DBResultToRowList(DBQueryResult &result, const char *type="util.Row")
Definition: EVEDBUtils.cpp:231
Packed row.
Definition: PyRep.h:961
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 DBResultToIntIntlistDict(DBQueryResult &result, std::map< int32, PyRep * > &into)
Definition: EVEDBUtils.cpp:495
PyObjectEx * DBResultToCIndexedRowset(DBQueryResult &result, const char *key)
Definition: EVEDBUtils.cpp:419
void DBResultToIntIntDict(DBQueryResult &result, std::map< int32, int32 > &into)
Definition: EVEDBUtils.cpp:463
PyPackedRow * DBRowToPackedRow(DBResultRow &row)
Definition: EVEDBUtils.cpp:453
Python list.
Definition: PyRep.h:639
PyObjectEx * DBResultToCRowset(DBQueryResult &result)
Definition: EVEDBUtils.cpp:402