18#ifndef DB2_FILE_LOADER_H
19#define DB2_FILE_LOADER_H
83 : Fields(fields), FieldCount(fieldCount), Meta(meta) { }
85 uint32 GetStringFieldCount(
bool localizedOnly)
const;
86 std::pair<
int32,
int32> GetFieldIndexByName(
char const* fieldName)
const;
87 int32 GetFieldIndexByMetaIndex(
uint32 metaIndex)
const;
115 virtual bool Read(
void* buffer, std::size_t numBytes) = 0;
139 explicit operator bool()
const;
144 uint8 GetUInt8(
char const* fieldName)
const;
146 uint16 GetUInt16(
char const* fieldName)
const;
148 uint32 GetUInt32(
char const* fieldName)
const;
150 int32 GetInt32(
char const* fieldName)
const;
152 uint64 GetUInt64(
char const* fieldName)
const;
154 float GetFloat(
char const* fieldName)
const;
155 char const* GetString(
uint32 field,
uint32 arrayIndex)
const;
156 char const* GetString(
char const* fieldName)
const;
161 void MakePersistent();
183 char const*
what() const noexcept
override {
return _msg.c_str(); }
202 char* AutoProduceData(
uint32& indexTableSize,
char**& indexTable);
204 void AutoProduceRecordCopies(
uint32 records,
char** indexTable,
char* dataTable);
207 uint32 GetRecordCount()
const;
208 uint32 GetRecordCopyCount()
const;
DB2EncryptedSectionHandling
constinit uint64 DUMMY_KNOWN_TACT_ID
DB2FileLoadException(std::string msg)
char const * what() const noexcept override
DB2Header const & GetHeader() const
DB2FileLoaderImpl * _impl
uint32 GetTableHash() const
DB2FileLoader & operator=(DB2FileLoader &&other) noexcept=delete
DB2FileLoader(DB2FileLoader &&other) noexcept=delete
uint32 GetLayoutHash() const
DB2FileLoader(DB2FileLoader const &other)=delete
DB2FileLoader & operator=(DB2FileLoader const &other)=delete
DB2Record & operator=(DB2Record &&other) noexcept=delete
DB2FileLoaderImpl const & _db2
std::size_t * _fieldOffsets
unsigned char const * _recordData
DB2Record & operator=(DB2Record const &other)=delete
TC_GAME_API uint32 GetId(std::string_view username)
constexpr DB2FileLoadInfo(DB2FieldMeta const *fields, std::size_t fieldCount, DB2Meta const *meta)
DB2FieldMeta const * Fields
DB2FileSource & operator=(DB2FileSource const &other)=delete
virtual int64 GetFileSize() const =0
virtual DB2EncryptedSectionHandling HandleEncryptedSection(DB2SectionHeader const §ionHeader) const =0
DB2FileSource & operator=(DB2FileSource &&other) noexcept=delete
virtual char const * GetFileName() const =0
virtual bool IsOpen() const =0
DB2FileSource(DB2FileSource &&other) noexcept=delete
virtual bool SetPosition(int64 position)=0
virtual bool Read(void *buffer, std::size_t numBytes)=0
DB2FileSource(DB2FileSource const &other)=delete
virtual int64 GetPosition() const =0