1 #ifndef OPENMW_ESM_READER_H
2 #define OPENMW_ESM_READER_H
72 void open(
const std::string &file);
74 void openRaw(
const std::string &filename);
105 template <
typename X>
114 template <
typename X>
117 assert(
sizeof(X) == size);
122 template <
typename X>
125 assert(
sizeof(X) == size);
133 template <
typename X>
139 std::stringstream error;
140 error <<
"getHT(): subrecord size mismatch (requested " <<
sizeof(X) <<
", got " <<
mCtx.
leftSub <<
")";
148 template <
typename X>
151 assert(
sizeof(X) == size);
247 template <
typename X>
258 void skip(
int bytes);
261 void fail(
const std::string &msg);
Files::IStreamPtr mEsm
Definition: esmreader.hpp:272
std::string getString(int size)
Definition: esmreader.cpp:328
void setEncoder(ToUTF8::Utf8Encoder *encoder)
Sets font encoder for ESM strings.
Definition: esmreader.cpp:367
std::string getHNString(const char *name)
Definition: esmreader.cpp:108
const Header & getHeader() const
Definition: esmreader.hpp:39
void openRaw(Files::IStreamPtr _esm, const std::string &name)
Definition: esmreader.cpp:62
void getHNExact(void *p, int size, const char *name)
Definition: esmreader.cpp:148
void getHNT(X &x, const char *name)
Definition: esmreader.hpp:98
int mIdx
Definition: esmreader.hpp:83
Definition: esmreader.hpp:21
std::vector< char > mBuffer
Definition: esmreader.hpp:281
Definition: esmcommon.hpp:89
unsigned int mRecordFlags
Definition: esmreader.hpp:276
uint32_t getSubSize() const
Definition: esmreader.hpp:42
int getIndex()
Definition: esmreader.hpp:85
void getHT(X &x)
Definition: esmreader.hpp:134
bool hasMoreRecs() const
Definition: esmreader.hpp:237
ESM_Context mCtx
Definition: esmreader.hpp:274
void getExact(void *x, int size)
Definition: esmreader.cpp:316
ESM_Context getContext()
Definition: esmreader.cpp:15
size_t getFileOffset()
Get the current position in the file. Make sure that the file has been opened!
Definition: esmreader.cpp:372
int64_t getHNLong(const char *name)
Definition: esmreader.cpp:94
void getSubHeader()
Definition: esmreader.cpp:248
void close()
Definition: esmreader.cpp:50
NAME getRecName()
Definition: esmreader.cpp:267
uint32_t leftRec
Definition: esmcommon.hpp:119
ESMReader()
Definition: esmreader.cpp:22
void skipHSubUntil(const char *name)
Definition: esmreader.cpp:237
bool isEmptyOrGetName()
Definition: esmreader.cpp:212
void setIndex(const int index)
Definition: esmreader.hpp:84
void skipRecord()
Definition: esmreader.cpp:282
std::string getName() const
Definition: esmreader.cpp:10
void getHNT(X &x, const char *name, int size)
Definition: esmreader.hpp:115
void open(Files::IStreamPtr _esm, const std::string &name)
Definition: esmreader.cpp:77
void getUint(uint32_t &u)
Definition: esmreader.hpp:252
void getSubHeaderIs(int size)
Definition: esmreader.cpp:260
size_t mFileSize
Definition: esmreader.hpp:288
size_t getFileSize() const
Definition: esmreader.hpp:269
Header mHeader
Definition: esmreader.hpp:283
void getHNOT(X &x, const char *name)
Definition: esmreader.hpp:106
void skipHSub()
Definition: esmreader.cpp:224
void getSubNameIs(const char *name)
Definition: esmreader.cpp:155
void setGlobalReaderList(std::vector< ESMReader > *list)
Definition: esmreader.hpp:87
bool hasMoreSubs() const
Definition: esmreader.hpp:238
std::string toString() const
Definition: esmcommon.hpp:58
Definition: esmcommon.hpp:116
void getSubName()
Definition: esmreader.cpp:197
boost::shared_ptr< std::istream > IStreamPtr
Definition: constrainedfilestream.hpp:20
void fail(const std::string &msg)
Used for error handling.
Definition: esmreader.cpp:352
void skipHSubSize(int size)
Definition: esmreader.cpp:230
void skip(int bytes)
Definition: esmreader.cpp:377
NAME subName
Definition: esmcommon.hpp:121
void restoreContext(const ESM_Context &rc)
Definition: esmreader.cpp:37
int index
Definition: esmcommon.hpp:125
int getVer() const
Definition: esmreader.hpp:33
int getRecordCount() const
Definition: esmreader.hpp:34
uint32_t leftSub
Definition: esmcommon.hpp:119
size_t leftFile
Definition: esmcommon.hpp:120
const NAME & retSubName() const
Definition: esmreader.hpp:41
void getT(X &x)
Definition: esmreader.hpp:248
Definition: esmcommon.hpp:14
std::string getHString()
Definition: esmreader.cpp:114
const std::string getDesc() const
Definition: esmreader.hpp:37
float getFVer() const
Definition: esmreader.hpp:35
bool peekNextSub(const char *name)
Definition: esmreader.cpp:179
std::vector< ESMReader > * mGlobalReaderList
Definition: esmreader.hpp:285
void cacheSubName()
Definition: esmreader.cpp:190
void getRecHeader()
Definition: esmreader.hpp:234
const std::string getAuthor() const
Definition: esmreader.hpp:36
ToUTF8::Utf8Encoder * mEncoder
Definition: esmreader.hpp:286
bool isNextSub(const char *name)
Definition: esmreader.cpp:164
Definition: to_utf8.hpp:25
std::vector< ESMReader > * getGlobalReaderList()
Definition: esmreader.hpp:88
const std::vector< Header::MasterData > & getGameFiles() const
Definition: esmreader.hpp:38
void getHNOT(X &x, const char *name, int size)
Definition: esmreader.hpp:123
unsigned int getRecordFlags()
Get record flags of last record.
Definition: esmreader.hpp:267
std::string getHNOString(const char *name)
Definition: esmreader.cpp:101
void getName(NAME &name)
Definition: esmreader.hpp:251
void getHT(X &x, int size)
Definition: esmreader.hpp:149
int getFormat() const
Definition: esmreader.cpp:32
const char * name
Definition: crashcatcher.cpp:59
void getHExact(void *p, int size)
Definition: esmreader.cpp:135