58 assert(field < file._fieldCount);
59 return *
reinterpret_cast<float*
>(
offset + field * 4);
64 assert(field < file._fieldCount);
65 return *
reinterpret_cast<unsigned int*
>(
offset + field * 4);
70 assert(field < file._fieldCount);
71 return *
reinterpret_cast<int*
>(
offset + field * 4);
76 assert(field < file._fieldCount);
77 size_t stringOffset =
getUInt(field);
78 assert(stringOffset < file._stringSize);
79 return reinterpret_cast<char*
>(file._stringTable + stringOffset);
const std::string & getMessage()
Definition: dbcfile.h:40
Record getRecord(size_t id)
Definition: dbcfile.cpp:81
void * HANDLE
Definition: CascPort.h:146
size_t getFieldCount() const
Definition: dbcfile.h:135
HANDLE _file
Definition: dbcfile.h:139
~DBCFile()
Definition: dbcfile.cpp:76
Iterator end()
Get begin iterator over records.
Definition: dbcfile.cpp:105
Record record
Definition: dbcfile.h:122
bool open()
Definition: dbcfile.cpp:29
unsigned char * _data
Definition: dbcfile.h:144
Iterator(DBCFile &file, unsigned char *offset)
Definition: dbcfile.h:97
char const * getString(size_t field) const
Definition: dbcfile.h:74
size_t _recordSize
Definition: dbcfile.h:140
Exception(const std::string &message)
Definition: dbcfile.h:38
Record(DBCFile &file, unsigned char *offset)
Definition: dbcfile.h:83
size_t getMaxId()
Definition: dbcfile.cpp:87
std::string message
Definition: dbcfile.h:42
unsigned char * _stringTable
Definition: dbcfile.h:145
unsigned char * offset
Definition: dbcfile.h:85
size_t _recordCount
Definition: dbcfile.h:141
DBCFile & file
Definition: dbcfile.h:84
virtual ~Exception()
Definition: dbcfile.h:39
int getInt(size_t field) const
Definition: dbcfile.h:68
Iterator begin()
Get begin iterator over records.
Definition: dbcfile.cpp:99
bool operator!=(Iterator const &b) const
Definition: dbcfile.h:116
float getFloat(size_t field) const
Definition: dbcfile.h:56
size_t _stringSize
Definition: dbcfile.h:143
unsigned int getUInt(size_t field) const
Definition: dbcfile.h:62
DBCFile(HANDLE file)
Definition: dbcfile.cpp:23
size_t getRecordCount() const
Trivial.
Definition: dbcfile.h:134
size_t _fieldCount
Definition: dbcfile.h:142
Record const * operator->() const
Definition: dbcfile.h:108
bool operator==(Iterator const &b) const
Comparison.
Definition: dbcfile.h:111
Iterator & operator=(Iterator const &right)
NotFound()
Definition: dbcfile.h:48
Record & operator=(Record const &right)
Record const & operator*() const
Return address of current instance.
Definition: dbcfile.h:107
Iterator & operator++()
Advance (prefix only)
Definition: dbcfile.h:100