TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
SqlDbc Struct Reference

#include <DBCStore.h>

Public Member Functions

 SqlDbc (std::string const *_filename, std::string const *_format, std::string const *_idname, char const *fmt)
 

Public Attributes

std::string constformatString
 
std::string constindexName
 
std::string sqlTableName
 
int32 indexPos
 
int32 sqlIndexPos
 

Private Member Functions

 SqlDbc (SqlDbc const &right)=delete
 
SqlDbcoperator= (SqlDbc const &right)=delete
 

Constructor & Destructor Documentation

SqlDbc::SqlDbc ( std::string const _filename,
std::string const _format,
std::string const _idname,
char const fmt 
)
inline
38  : formatString(_format), indexName (_idname), sqlIndexPos(0)
39  {
40  // Convert dbc file name to sql table name
41  sqlTableName = *_filename;
42  for (uint32 i = 0; i< sqlTableName.size(); ++i)
43  {
44  if (isalpha(sqlTableName[i]))
45  sqlTableName[i] = char(tolower(sqlTableName[i]));
46  else if (sqlTableName[i] == '.')
47  sqlTableName[i] = '_';
48  }
49 
50  // Get sql index position
52  if (indexPos >= 0)
53  {
54  uint32 uindexPos = uint32(indexPos);
55  for (uint32 x = 0; x < formatString->size(); ++x)
56  {
57  // Count only fields present in sql
58  if ((*formatString)[x] == FT_SQL_PRESENT)
59  {
60  if (x == uindexPos)
61  break;
62  ++sqlIndexPos;
63  }
64  }
65  }
66  }
std::string const * indexName
Definition: DBCStore.h:33
int32 sqlIndexPos
Definition: DBCStore.h:36
std::string const * formatString
Definition: DBCStore.h:32
int32 indexPos
Definition: DBCStore.h:35
std::string sqlTableName
Definition: DBCStore.h:34
uint32_t uint32
Definition: Define.h:150
static uint32 GetFormatRecordSize(const char *format, int32 *index_pos=NULL)
Definition: DBCFileLoader.cpp:128
Definition: format.h:285
uint32_t uint32
Definition: g3dmath.h:168
G3D::int16 x
Definition: Vector2int16.h:37
Definition: Define.h:166

+ Here is the call graph for this function:

SqlDbc::SqlDbc ( SqlDbc const right)
privatedelete

Member Function Documentation

SqlDbc& SqlDbc::operator= ( SqlDbc const right)
privatedelete

Member Data Documentation

std::string const* SqlDbc::formatString
std::string const* SqlDbc::indexName
int32 SqlDbc::indexPos
int32 SqlDbc::sqlIndexPos
std::string SqlDbc::sqlTableName

The documentation for this struct was generated from the following file: