From 26b5e033ffde3d161382fc9addbfa99738379641 Mon Sep 17 00:00:00 2001 From: maximius Date: Sat, 17 Oct 2009 15:35:07 -0700 Subject: *Massive cleanup (\n\n -> \n, *\n -> \n, cleanup for(...) to for (...), and some other cleanups by hand) *Fix a possible crash in Spell::DoAllEffectOnTarget --HG-- branch : trunk --- src/shared/Database/SQLStorage.h | 19 ------------------- 1 file changed, 19 deletions(-) (limited to 'src/shared/Database/SQLStorage.h') diff --git a/src/shared/Database/SQLStorage.h b/src/shared/Database/SQLStorage.h index cc165af532e..96f817c64e7 100644 --- a/src/shared/Database/SQLStorage.h +++ b/src/shared/Database/SQLStorage.h @@ -17,27 +17,21 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - #ifndef SQLSTORAGE_H #define SQLSTORAGE_H - #include "Common.h" #include "Database/DatabaseEnv.h" - class SQLStorage { template friend struct SQLStorageLoaderBase; - public: - SQLStorage(const char* fmt, const char * _entry_field, const char * sqlname) { src_format = fmt; dst_format = fmt; init(_entry_field, sqlname); } - SQLStorage(const char* src_fmt, const char* dst_fmt, const char * _entry_field, const char * sqlname) { src_format = src_fmt; @@ -45,12 +39,10 @@ class SQLStorage init(_entry_field, sqlname); } - ~SQLStorage() { Free(); } - template T const* LookupEntry(uint32 id) const { @@ -60,16 +52,12 @@ class SQLStorage return NULL; return reinterpret_cast(pIndex[id]); } - uint32 RecordCount; uint32 MaxEntry; uint32 iNumFields; - char const* GetTableName() const { return table; } - void Load(); void Free(); - private: void init(const char * _entry_field, const char * sqlname) { @@ -80,9 +68,7 @@ class SQLStorage iNumFields = strlen(src_format); MaxEntry = 0; } - char** pIndex; - char *data; const char *src_format; const char *dst_format; @@ -90,13 +76,11 @@ class SQLStorage const char *entry_field; //bool HasString; }; - template struct SQLStorageLoaderBase { public: void Load(SQLStorage &storage); - template void convert(uint32 field_pos, S src, D &dst); template @@ -104,16 +88,13 @@ struct SQLStorageLoaderBase template void convert_from_str(uint32 field_pos, char * src, D& dst); void convert_str_to_str(uint32 field_pos, char *src, char *&dst); - private: template void storeValue(V value, SQLStorage &store, char *p, int x, uint32 &offset); void storeValue(char * value, SQLStorage &store, char *p, int x, uint32 &offset); }; - struct SQLStorageLoader : public SQLStorageLoaderBase { }; - #endif -- cgit v1.2.3