AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
DBCFileLoader::Record Class Reference

#include "DBCFileLoader.h"

Public Member Functions

float getFloat (std::size_t field) const
 
uint32 getUInt (std::size_t field) const
 
uint8 getUInt8 (std::size_t field) const
 
const char * getString (std::size_t field) const
 

Private Member Functions

 Record (DBCFileLoader &file_, unsigned char *offset_)
 

Private Attributes

unsigned char * offset
 
DBCFileLoaderfile
 

Friends

class DBCFileLoader
 

Detailed Description

Constructor & Destructor Documentation

◆ Record()

DBCFileLoader::Record::Record ( DBCFileLoader file_,
unsigned char *  offset_ 
)
inlineprivate
80: offset(offset_), file(file_) { }
unsigned char * offset
Definition: DBCFileLoader.h:81
DBCFileLoader & file
Definition: DBCFileLoader.h:82

Member Function Documentation

◆ getFloat()

float DBCFileLoader::Record::getFloat ( std::size_t  field) const
inline
50 {
51 ASSERT(field < file.fieldCount);
52 float val = *reinterpret_cast<float*>(offset + file.GetOffset(field));
53 EndianConvert(val);
54 return val;
55 }
void EndianConvert(T &val)
Definition: ByteConverter.h:47
#define ASSERT
Definition: Errors.h:68
uint32 fieldCount
Definition: DBCFileLoader.h:102
uint32 GetOffset(std::size_t id) const
Definition: DBCFileLoader.h:93

References ASSERT, EndianConvert(), DBCFileLoader::fieldCount, file, DBCFileLoader::GetOffset(), and offset.

Referenced by DBCFileLoader::AutoProduceData().

◆ getString()

const char * DBCFileLoader::Record::getString ( std::size_t  field) const
inline
72 {
73 ASSERT(field < file.fieldCount);
74 std::size_t stringOffset = getUInt(field);
75 ASSERT(stringOffset < file.stringSize);
76 return reinterpret_cast<char*>(file.stringTable + stringOffset);
77 }
uint32 stringSize
Definition: DBCFileLoader.h:103
unsigned char * stringTable
Definition: DBCFileLoader.h:106
uint32 getUInt(std::size_t field) const
Definition: DBCFileLoader.h:57

References ASSERT, DBCFileLoader::fieldCount, file, getUInt(), DBCFileLoader::stringSize, and DBCFileLoader::stringTable.

Referenced by DBCFileLoader::AutoProduceStrings().

◆ getUInt()

uint32 DBCFileLoader::Record::getUInt ( std::size_t  field) const
inline
58 {
59 ASSERT(field < file.fieldCount);
60 uint32 val = *reinterpret_cast<uint32*>(offset + file.GetOffset(field));
61 EndianConvert(val);
62 return val;
63 }
std::uint32_t uint32
Definition: Define.h:107

References ASSERT, EndianConvert(), DBCFileLoader::fieldCount, file, DBCFileLoader::GetOffset(), and offset.

Referenced by DBCFileLoader::AutoProduceData(), and getString().

◆ getUInt8()

uint8 DBCFileLoader::Record::getUInt8 ( std::size_t  field) const
inline
66 {
67 ASSERT(field < file.fieldCount);
68 return *reinterpret_cast<uint8*>(offset + file.GetOffset(field));
69 }
std::uint8_t uint8
Definition: Define.h:109

References ASSERT, DBCFileLoader::fieldCount, file, DBCFileLoader::GetOffset(), and offset.

Referenced by DBCFileLoader::AutoProduceData().

Friends And Related Function Documentation

◆ DBCFileLoader

friend class DBCFileLoader
friend

Member Data Documentation

◆ file

DBCFileLoader& DBCFileLoader::Record::file
private

Referenced by getFloat(), getString(), getUInt(), and getUInt8().

◆ offset

unsigned char* DBCFileLoader::Record::offset
private

Referenced by getFloat(), getUInt(), and getUInt8().