18#ifndef DBC_FILE_LOADER_H
19#define DBC_FILE_LOADER_H
46 bool Load(
const char *filename,
const char *
fmt);
53 ASSERT(field < file.fieldCount);
54 float val = *
reinterpret_cast<float*
>(offset+file.GetOffset(field));
60 ASSERT(field < file.fieldCount);
61 uint32 val = *
reinterpret_cast<uint32*
>(offset+file.GetOffset(field));
67 ASSERT(field < file.fieldCount);
68 return *
reinterpret_cast<uint8*
>(offset+file.GetOffset(field));
73 ASSERT(field < file.fieldCount);
74 size_t stringOffset = getUInt(field);
75 ASSERT(stringOffset < file.stringSize);
76 return reinterpret_cast<char*
>(file.stringTable + stringOffset);
void EndianConvert(T &val)
Record(DBCFileLoader &file_, unsigned char *offset_)
const char * getString(size_t field) const
uint32 getUInt(size_t field) const
float getFloat(size_t field) const
uint8 getUInt8(size_t field) const
char * AutoProduceStrings(char const *fmt, char *dataTable)
Record getRecord(size_t id)
DBCFileLoader(DBCFileLoader const &right)=delete
unsigned char * stringTable
uint32 GetOffset(size_t id) const
static uint32 GetFormatRecordSize(const char *format, int32 *index_pos=nullptr)
DBCFileLoader & operator=(DBCFileLoader const &right)=delete
uint32 GetNumRows() const
Get begin iterator over records.
uint32 GetRowSize() const
char * AutoProduceData(char const *fmt, uint32 &count, char **&indexTable)