73 std::size_t fields = strlen(
_format);
74 for (
uint32 i = 0; i < fields; ++i)
84 buffer << *(
float*)entry;
88 buffer << *(
uint8*)entry;
94 if (locStr->
Str[locale][0] ==
'\0')
97 char const* str = locStr->
Str[locale];
98 std::size_t len = strlen(str);
99 buffer <<
uint16(len ? len + 1 : 0);
110 char const* str = *(
char const**)entry;
111 std::size_t len = strlen(str);
112 buffer <<
uint16(len ? len + 1 : 0);
118 entry +=
sizeof(
char const*);
181 char* extraStringHolders =
nullptr;
185 if (extraStringHolders)
201 ASSERT(strpbrk(
_format,
"nd") ==
nullptr,
"Only non-indexed storages can be sorted");
void format(BasicFormatter< Char > &f, const Char *&format_str, const T &value)
Definition: format.h:2963
bool Load(const char *filename, const char *fmt)
Definition: DB2StorageLoader.cpp:44
HotfixDatabaseStatements
Definition: HotfixDatabase.h:24
T * _dataTable
Definition: DB2Store.h:218
T * ASSERT_NOTNULL(T *pointer)
Definition: Errors.h:58
Definition: ByteBuffer.h:70
std::list< char * > StringPoolList
Definition: DB2Store.h:47
void EraseRecord(uint32 id) override
Definition: DB2Store.h:125
void WriteRecord(uint32 id, uint32 locale, ByteBuffer &buffer) const override
Definition: DB2Store.h:67
void Sort(SortFunc pred)
Definition: DB2Store.h:199
T ** AsT
Definition: DB2Store.h:215
uint32 GetHash() const
Definition: DB2StorageLoader.h:87
virtual ~DB2StorageBase()
Definition: DB2Store.h:30
uint32 _tableHash
Definition: DB2Store.h:41
arena_t NULL
Definition: jemalloc_internal.h:624
bool HasRecord(uint32 id) const override
Definition: DB2Store.h:66
char * AutoProduceStringsArrayHolders(const char *fmt, char *dataTable)
Definition: DB2StorageLoader.cpp:343
bool(* SortFunc)(T const *left, T const *right)
Definition: DB2Store.h:197
uint32 GetFieldCount() const
Definition: DB2Store.h:133
uint16_t uint16
Definition: g3dmath.h:166
char const * _format
Definition: DB2Store.h:212
#define bool
Definition: CascPort.h:16
std::string const & GetFileName() const
Definition: DB2Store.h:130
static uint32 GetFormatLocalizedStringFieldCount(const char *format)
Definition: DB2StorageLoader.cpp:255
Definition: DBStorageIterator.h:25
virtual bool HasRecord(uint32 id) const =0
char const * Str[TOTAL_LOCALES]
Definition: Common.h:148
bool Load(std::string const &path, uint32 locale)
Definition: DB2Store.h:134
virtual void EraseRecord(uint32 id)=0
Interface class for common access.
Definition: DB2Store.h:27
char * AutoProduceData(const char *fmt, uint32 &count, char **&indexTable)
Definition: DB2StorageLoader.cpp:265
T * _dataTableEx
Definition: DB2Store.h:219
HotfixDatabaseStatements _hotfixStatement
Definition: DB2Store.h:221
Definition: DB2StorageLoader.h:27
uint32 GetCols() const
Definition: DB2StorageLoader.h:85
uint32_t uint32
Definition: Define.h:150
T const * AssertEntry(uint32 id) const
Definition: DB2Store.h:128
bool left(const int *a, const int *b, const int *c)
Definition: RecastContour.cpp:487
uint32 GetHash() const
Definition: DB2Store.h:32
char const * GetFormat() const
Definition: DB2Store.h:132
void append(T value)
Definition: ByteBuffer.h:143
uint8_t uint8
Definition: g3dmath.h:164
DBStorageIterator< T > iterator
Definition: DB2Store.h:49
iterator begin()
Definition: DB2Store.h:205
Definition: DB2Store.h:45
bool LoadStringsFrom(std::string const &path, uint32 locale)
Definition: DB2Store.h:161
Definition: DB2StorageLoader.h:117
void LoadStringsFromDB(uint32 locale)
Definition: DB2Store.h:189
virtual void WriteRecord(uint32 id, uint32 locale, ByteBuffer &buffer) const =0
T const * LookupEntry(uint32 id) const
Definition: DB2Store.h:127
void LoadFromDB()
Definition: DB2Store.h:179
~DB2Storage()
Definition: DB2Store.h:57
DB2Storage(char const *fileName, char const *format, HotfixDatabaseStatements preparedStmtIndex)
Definition: DB2Store.h:51
char * AutoProduceStrings(const char *fmt, char *dataTable, uint32 locale)
Definition: DB2StorageLoader.cpp:412
uint8_t uint8
Definition: Define.h:152
std::string _fileName
Definition: DB2Store.h:209
#define ASSERT
Definition: Errors.h:55
iterator end()
Definition: DB2Store.h:206
StringPoolList _stringPoolList
Definition: DB2Store.h:220
uint32 GetNumRows() const
Definition: DB2Store.h:131
void LoadStrings(const char *format, HotfixDatabaseStatements preparedStatement, uint32 locale, char **&indexTable, std::list< char * > &stringPool)
Definition: DB2StorageLoader.cpp:643
uint32 _indexTableSize
Definition: DB2Store.h:210
union DB2Storage::@338 _indexTable
char ** AsChar
Definition: DB2Store.h:216
uint32 _fieldCount
Definition: DB2Store.h:211