EvEmu  0.8.4
11 September 2021
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
dbtype.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum  DBTYPE {
  DBTYPE_EMPTY = 0x00, DBTYPE_I2 = 0x02, DBTYPE_I4 = 0x03, DBTYPE_R4 = 0x04,
  DBTYPE_R8 = 0x05, DBTYPE_CY = 0x06, DBTYPE_ERROR = 0x0A, DBTYPE_BOOL = 0x0B,
  DBTYPE_I1 = 0x10, DBTYPE_UI1 = 0x11, DBTYPE_UI2 = 0x12, DBTYPE_UI4 = 0x13,
  DBTYPE_I8 = 0x14, DBTYPE_UI8 = 0x15, DBTYPE_FILETIME = 0x40, DBTYPE_BYTES = 0x80,
  DBTYPE_STR = 0x81, DBTYPE_WSTR = 0x82
}
 

Functions

uint8 DBTYPE_GetSizeBits (DBTYPE type)
 
uint8 DBTYPE_GetSizeBytes (DBTYPE type)
 

Enumeration Type Documentation

enum DBTYPE
Enumerator
DBTYPE_EMPTY 
DBTYPE_I2 
DBTYPE_I4 
DBTYPE_R4 
DBTYPE_R8 
DBTYPE_CY 
DBTYPE_ERROR 
DBTYPE_BOOL 
DBTYPE_I1 
DBTYPE_UI1 
DBTYPE_UI2 
DBTYPE_UI4 
DBTYPE_I8 
DBTYPE_UI8 
DBTYPE_FILETIME 
DBTYPE_BYTES 
DBTYPE_STR 
DBTYPE_WSTR 

Definition at line 67 of file dbtype.h.

68 {
69  DBTYPE_EMPTY = 0x00,
70  //DBTYPE_NULL = 0x01, // not supported
71  DBTYPE_I2 = 0x02,
72  DBTYPE_I4 = 0x03,
73  DBTYPE_R4 = 0x04,
74  DBTYPE_R8 = 0x05,
75  DBTYPE_CY = 0x06, // money
76  //DBTYPE_DATE = 0x07, // not supported
77  //DBTYPE_BSTR = 0x08, // not supported
78  //DBTYPE_IDISPATCH = 0x09, // not supported
79  DBTYPE_ERROR = 0x0A,
80  DBTYPE_BOOL = 0x0B,
81  //DBTYPE_VARIANT = 0x0C, // not supported
82  //DBTYPE_IUNKNOWN = 0x0D, // not supported
83  //DBTYPE_DECIMAL = 0x0E, // not supported
84  //DBTYPE_BLOB = 0x0F, // not supported
85  DBTYPE_I1 = 0x10,
86  DBTYPE_UI1 = 0x11,
87  DBTYPE_UI2 = 0x12,
88  DBTYPE_UI4 = 0x13,
89  DBTYPE_I8 = 0x14,
90  DBTYPE_UI8 = 0x15,
91  DBTYPE_FILETIME = 0x40, // 64-bit timestamp
92  //DBTYPE_GUID = 0x48, // not supported
93  DBTYPE_BYTES = 0x80, // client defined as 0x1fc, but error when used: Exception: <type 'exceptions.TypeError'>, DBRowDescriptor doesn't support data type 508
94  DBTYPE_STR = 0x81,
95  DBTYPE_WSTR = 0x82,
96  //DBTYPE_NUMERIC = 0x83, // not supported
97  //DBTYPE_UDT = 0x84, // not supported
98  //DBTYPE_DBDATE = 0x85, // not supported
99  //DBTYPE_DBTIME = 0x86, // not supported
100  //DBTYPE_DBTIMESTAMP = 0x87, // not supported -client has this one defined
101  //DBTYPE_HCHAPTER = 0x88, // not supported
102  //DBTYPE_PROPVARIANT = 0x8A, // not supported
103  //DBTYPE_VARNUMERIC = 0x8B // not supported
104 };

Function Documentation

uint8 DBTYPE_GetSizeBits ( DBTYPE  type)

Returns length of field of given type.

Parameters
[in]typeType of fields.
Returns
Length of field (in bits).

Definition at line 30 of file dbtype.cpp.

References DBTYPE_BOOL, DBTYPE_BYTES, DBTYPE_CY, DBTYPE_FILETIME, DBTYPE_I1, DBTYPE_I2, DBTYPE_I4, DBTYPE_I8, DBTYPE_R4, DBTYPE_R8, DBTYPE_STR, DBTYPE_UI1, DBTYPE_UI2, DBTYPE_UI4, DBTYPE_UI8, and DBTYPE_WSTR.

Referenced by DBTYPE_GetSizeBytes(), UnmarshalStream::LoadPackedRow(), and MarshalStream::VisitPackedRow().

31 {
32  switch( type )
33  {
34  case DBTYPE_I8:
35  case DBTYPE_UI8:
36  case DBTYPE_R8:
37  case DBTYPE_CY:
38  case DBTYPE_FILETIME:
39  return 64;
40  case DBTYPE_I4:
41  case DBTYPE_UI4:
42  case DBTYPE_R4:
43  return 32;
44  case DBTYPE_I2:
45  case DBTYPE_UI2:
46  return 16;
47  case DBTYPE_I1:
48  case DBTYPE_UI1:
49  return 8;
50  case DBTYPE_BOOL:
51  return 1;
52  case DBTYPE_BYTES:
53  case DBTYPE_STR:
54  case DBTYPE_WSTR:
55  return 0;
56  }
57 
58  return 0;
59 }

Here is the caller graph for this function:

uint8 DBTYPE_GetSizeBytes ( DBTYPE  type)

Returns length of field of given type.

Parameters
[in]typeType of fields.
Returns
Length of field (in bytes).

Definition at line 61 of file dbtype.cpp.

References DBTYPE_GetSizeBits().

62 {
63  return ( ( DBTYPE_GetSizeBits( type ) + 7 ) >> 3 );
64 }
uint8 DBTYPE_GetSizeBits(DBTYPE type)
Definition: dbtype.cpp:30

Here is the call graph for this function: