diff options
author | QAston <none@none> | 2009-08-27 17:59:01 +0200 |
---|---|---|
committer | QAston <none@none> | 2009-08-27 17:59:01 +0200 |
commit | 94b8532c4fe95b4d31f088f3925df7637c13b9b1 (patch) | |
tree | 9bee986c4290aa6403fbea0b54cf8be1137f8b62 /src/shared/Database/DBCStore.h | |
parent | 6b703d600bd08fa642a2e121fb53d5749d677076 (diff) |
*Fix build with GCC.
--HG--
branch : trunk
Diffstat (limited to 'src/shared/Database/DBCStore.h')
-rw-r--r-- | src/shared/Database/DBCStore.h | 76 |
1 files changed, 38 insertions, 38 deletions
diff --git a/src/shared/Database/DBCStore.h b/src/shared/Database/DBCStore.h index ee9c092708d..e88253564d3 100644 --- a/src/shared/Database/DBCStore.h +++ b/src/shared/Database/DBCStore.h @@ -21,7 +21,44 @@ #include "DBCFileLoader.h" #include "Log.h" -struct SqlDbc; + +struct SqlDbc +{ + const std::string * formatString; + const std::string * indexName; + std::string sqlTableName; + int32 indexPos; + int32 sqlIndexPos; + SqlDbc(const std::string * _filename, const std::string * _format, const std::string * _idname, const char * fmt) + :formatString(_format),sqlIndexPos(0), indexName (_idname) + { + // Convert dbc file name to sql table name + sqlTableName = *_filename; + for (uint32 i = 0;i< sqlTableName.size();++i) + { + if (isalpha(sqlTableName[i])) + sqlTableName[i] = tolower(sqlTableName[i]); + else if (sqlTableName[i] == '.') + sqlTableName[i] = '_'; + } + + // Get sql index position + DBCFileLoader::GetFormatRecordSize(fmt, &indexPos); + if (indexPos>=0) + { + for(uint32 x=0;x < formatString->size();x++) + { + // Count only fields present in sql + if ((*formatString)[x] == FT_SQL_PRESENT) + { + if (x == indexPos) + break; + ++sqlIndexPos; + } + } + } + } +}; template<class T> class DBCStorage @@ -229,41 +266,4 @@ class DBCStorage StringPoolList m_stringPoolList; }; -struct SqlDbc -{ - const std::string * formatString; - const std::string * indexName; - std::string sqlTableName; - int32 indexPos; - int32 sqlIndexPos; - SqlDbc(const std::string * _filename, const std::string * _format, const std::string * _idname, const char * fmt) - :formatString(_format),sqlIndexPos(0), indexName (_idname) - { - // Convert dbc file name to sql table name - sqlTableName = *_filename; - for (uint32 i = 0;i< sqlTableName.size();++i) - { - if (isalpha(sqlTableName[i])) - sqlTableName[i] = tolower(sqlTableName[i]); - else if (sqlTableName[i] == '.') - sqlTableName[i] = '_'; - } - - // Get sql index position - DBCFileLoader::GetFormatRecordSize(fmt, &indexPos); - if (indexPos>=0) - { - for(uint32 x=0;x < formatString->size();x++) - { - // Count only fields present in sql - if ((*formatString)[x] == FT_SQL_PRESENT) - { - if (x == indexPos) - break; - ++sqlIndexPos; - } - } - } - } -}; #endif |