[11999.5] Support loading tables with default filling into SQL-Loader

* Add special field markers to fill a column in SQLStorage with default values
* Add a safeguard to DBCStorage::EraseEntry, Add helper function DBCStorage::InsertEntry to store content

Note: If required similar adjustments to DBCStorage might be reasonable if required
This commit is contained in:
Schmoozerd 2012-06-12 23:09:16 +02:00
parent 1c1bc5c659
commit 969c10a8d9
5 changed files with 102 additions and 34 deletions

View file

@ -29,7 +29,7 @@ class DBCStorage
explicit DBCStorage(const char *f) : nCount(0), fieldCount(0), fmt(f), indexTable(NULL), m_dataTable(NULL) { }
~DBCStorage() { Clear(); }
T const* LookupEntry(uint32 id) const { return (id>=nCount)?NULL:indexTable[id]; }
T const* LookupEntry(uint32 id) const { return (id >= nCount) ? NULL : indexTable[id]; }
uint32 GetNumRows() const { return nCount; }
char const* GetFormat() const { return fmt; }
uint32 GetFieldCount() const { return fieldCount; }
@ -88,7 +88,8 @@ class DBCStorage
nCount = 0;
}
void EraseEntry(uint32 id) { indexTable[id] = NULL; }
void EraseEntry(uint32 id) { assert(id < nCount && "To be erased entry must be in bounds!") ; indexTable[id] = NULL; }
void InsertEntry(T* entry, uint32 id) { assert(id < nCount && "To be inserted entry must be in bounds!"); indexTable[id] = entry; }
private:
uint32 nCount;