EvEmu
0.8.4
11 September 2021
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
RowsetToSQL.cpp
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, Bloody.Rabbit
24
*/
25
26
#include "
eve-common.h
"
27
28
#include "
database/RowsetToSQL.h
"
29
30
const
size_t
INSERT_QUERY_ROW_LIMIT
= 1024;
31
32
/************************************************************************/
33
/* ReaderColumnContentDesc */
34
/************************************************************************/
35
const
char
*
const
ReaderColumnContentDesc::smTypeStrings
[] =
36
{
37
"int"
,
/* TYPE_INT */
38
"real"
,
/* TYPE_FLOAT */
39
"text /* ascii */"
,
/* TYPE_STRING */
40
"text /* utf8 */"
,
/* TYPE_WSTRING */
41
"UNKNOWN"
,
/* TYPE_UNKNOWN */
42
"ERROR"
,
/* TYPE_ERROR */
43
};
44
45
const
char
*
const
ReaderColumnContentDesc::smNullStrings
[] =
46
{
47
"NOT NULL"
,
/* !isNull */
48
"NULL"
,
/* isNull */
49
};
50
51
ReaderColumnContentDesc::ReaderColumnContentDesc
()
52
: mType( TYPE_UNKNOWN ),
53
mIsNull( false )
54
{
55
}
56
57
void
ReaderColumnContentDesc::Process
(
const
PyRep::PyType
t )
58
{
59
switch
( t )
60
{
61
case
PyRep::PyTypeNone
:
62
mIsNull
=
true
;
63
break
;
64
65
case
PyRep::PyTypeBool
:
66
case
PyRep::PyTypeInt
:
67
case
PyRep::PyTypeLong
:
68
switch
(
mType
)
69
{
70
case
TYPE_UNKNOWN
:
71
mType
=
TYPE_INTEGER
;
72
break
;
73
case
TYPE_INTEGER
:
74
case
TYPE_FLOAT
:
75
break
;
76
default
:
77
mType
=
TYPE_ERROR
;
78
break
;
79
}
80
break
;
81
82
case
PyRep::PyTypeFloat
:
83
switch
(
mType
)
84
{
85
case
TYPE_UNKNOWN
:
86
case
TYPE_INTEGER
:
87
mType
=
TYPE_FLOAT
;
88
break
;
89
case
TYPE_FLOAT
:
90
break
;
91
default
:
92
mType
=
TYPE_ERROR
;
93
break
;
94
}
95
break
;
96
97
case
PyRep::PyTypeString
:
98
switch
(
mType
)
99
{
100
case
TYPE_UNKNOWN
:
101
mType
=
TYPE_STRING
;
102
break
;
103
case
TYPE_STRING
:
104
case
TYPE_WSTRING
:
105
break
;
106
default
:
107
mType
=
TYPE_ERROR
;
108
break
;
109
}
110
break
;
111
112
case
PyRep::PyTypeWString
:
113
switch
(
mType
)
114
{
115
case
TYPE_UNKNOWN
:
116
case
TYPE_STRING
:
117
mType
=
TYPE_WSTRING
;
118
break
;
119
case
TYPE_WSTRING
:
120
break
;
121
default
:
122
mType
=
TYPE_ERROR
;
123
break
;
124
}
125
break
;
126
127
default
:
128
mType
=
TYPE_ERROR
;
129
break
;
130
}
131
}
INSERT_QUERY_ROW_LIMIT
const size_t INSERT_QUERY_ROW_LIMIT
Definition:
RowsetToSQL.cpp:30
ReaderColumnContentDesc::smTypeStrings
static const char *const smTypeStrings[]
Definition:
RowsetToSQL.h:83
ReaderColumnContentDesc::TYPE_WSTRING
Definition:
RowsetToSQL.h:50
ReaderColumnContentDesc::smNullStrings
static const char *const smNullStrings[]
Definition:
RowsetToSQL.h:85
ReaderColumnContentDesc::ReaderColumnContentDesc
ReaderColumnContentDesc()
Definition:
RowsetToSQL.cpp:51
ReaderColumnContentDesc::TYPE_ERROR
Definition:
RowsetToSQL.h:53
ReaderColumnContentDesc::mIsNull
bool mIsNull
Definition:
RowsetToSQL.h:80
ReaderColumnContentDesc::TYPE_INTEGER
Definition:
RowsetToSQL.h:47
PyRep::PyTypeNone
Definition:
PyRep.h:86
ReaderColumnContentDesc::Process
void Process(const PyRep::PyType t)
Processes PyRep type to determine type of column.
Definition:
RowsetToSQL.cpp:57
PyRep::PyTypeLong
Definition:
PyRep.h:76
PyRep::PyTypeInt
Definition:
PyRep.h:75
PyRep::PyType
PyType
Python wire object types.
Definition:
PyRep.h:72
RowsetToSQL.h
ReaderColumnContentDesc::TYPE_STRING
Definition:
RowsetToSQL.h:49
ReaderColumnContentDesc::mType
ColumnType mType
Definition:
RowsetToSQL.h:78
eve-common.h
PyRep::PyTypeBool
Definition:
PyRep.h:78
PyRep::PyTypeWString
Definition:
PyRep.h:81
PyRep::PyTypeString
Definition:
PyRep.h:80
ReaderColumnContentDesc::TYPE_UNKNOWN
Definition:
RowsetToSQL.h:52
ReaderColumnContentDesc::TYPE_FLOAT
Definition:
RowsetToSQL.h:48
PyRep::PyTypeFloat
Definition:
PyRep.h:77
backups
local
src
eve
EvEmu_Crucible
src
eve-common
database
RowsetToSQL.cpp
Generated on Sat Oct 16 2021 01:20:31 for EvEmu by
1.8.8