aboutsummaryrefslogtreecommitdiff
path: root/src/shared/Database/SQLStorage.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared/Database/SQLStorage.h')
-rw-r--r--src/shared/Database/SQLStorage.h19
1 files changed, 0 insertions, 19 deletions
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<class T>
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<class T>
T const* LookupEntry(uint32 id) const
{
@@ -60,16 +52,12 @@ class SQLStorage
return NULL;
return reinterpret_cast<T const*>(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 <class T>
struct SQLStorageLoaderBase
{
public:
void Load(SQLStorage &storage);
-
template<class S, class D>
void convert(uint32 field_pos, S src, D &dst);
template<class S>
@@ -104,16 +88,13 @@ struct SQLStorageLoaderBase
template<class D>
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<class V>
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<SQLStorageLoader>
{
};
-
#endif