OpenMW
Public Member Functions | Public Attributes | Private Attributes
ESM::ESMReader Class Reference

#include <esmreader.hpp>

List of all members.

Public Member Functions

 ESMReader ()
int getVer () const
float getFVer () const
const std::string getAuthor () const
const std::string getDesc () const
const std::vector
< Header::MasterData > & 
getGameFiles () const
int getFormat () const
const NAMEretSubName () const
uint32_t getSubSize () const
ESM_Context getContext ()
void restoreContext (const ESM_Context &rc)
void close ()
void openRaw (Ogre::DataStreamPtr _esm, const std::string &name)
void open (Ogre::DataStreamPtr _esm, const std::string &name)
void open (const std::string &file)
void openRaw (const std::string &file)
size_t getFileSize ()
 Get the file size. Make sure that the file has been opened!
size_t getFileOffset ()
 Get the current position in the file. Make sure that the file has been opened!
void setIndex (const int index)
const int getIndex ()
void setGlobalReaderList (std::vector< ESMReader > *list)
std::vector< ESMReader > * getGlobalReaderList ()
template<typename X >
void getHNT (X &x, const char *name)
template<typename X >
void getHNOT (X &x, const char *name)
template<typename X >
void getHNT (X &x, const char *name, int size)
template<typename X >
void getHNOT (X &x, const char *name, int size)
int64_t getHNLong (const char *name)
template<typename X >
void getHT (X &x)
template<typename X >
void getHT (X &x, int size)
std::string getHNOString (const char *name)
std::string getHNString (const char *name)
std::string getHString ()
void getHExact (void *p, int size)
void getHNExact (void *p, int size, const char *name)
void getSubNameIs (const char *name)
bool isNextSub (const char *name)
void getSubName ()
bool isEmptyOrGetName ()
void skipHSub ()
void skipHSubSize (int size)
void getSubHeader ()
void getSubHeaderIs (int size)
NAME getRecName ()
void skipRecord ()
void skipHRecord ()
void getRecHeader ()
void getRecHeader (uint32_t &flags)
bool hasMoreRecs () const
bool hasMoreSubs () const
template<typename X >
void getT (X &x)
void getExact (void *x, int size)
void getName (NAME &name)
void getUint (uint32_t &u)
std::string getString (int size)
void skip (int bytes)
uint64_t getOffset ()
void fail (const std::string &msg)
 Used for error handling.
void setEncoder (ToUTF8::Utf8Encoder *encoder)
 Sets font encoder for ESM strings.
unsigned int getRecordFlags ()
 Get record flags of last record.

Public Attributes

int mIdx

Private Attributes

Ogre::DataStreamPtr mEsm
ESM_Context mCtx
unsigned int mRecordFlags
std::vector< char > mBuffer
Header mHeader
std::vector< ESMReader > * mGlobalReaderList
ToUTF8::Utf8EncodermEncoder

Constructor & Destructor Documentation


Member Function Documentation

Close the file, resets all information. After calling close() the structure may be reused to load a new file.

void ESM::ESMReader::fail ( const std::string &  msg)

Used for error handling.

const std::string ESM::ESMReader::getAuthor ( ) const [inline]

Save the current file position and information in a ESM_Context struct

const std::string ESM::ESMReader::getDesc ( ) const [inline]
void ESM::ESMReader::getExact ( void *  x,
int  size 
)
size_t ESM::ESMReader::getFileOffset ( ) [inline]

Get the current position in the file. Make sure that the file has been opened!

size_t ESM::ESMReader::getFileSize ( ) [inline]

Get the file size. Make sure that the file has been opened!

float ESM::ESMReader::getFVer ( ) const [inline]
const std::vector<Header::MasterData>& ESM::ESMReader::getGameFiles ( ) const [inline]
std::vector<ESMReader>* ESM::ESMReader::getGlobalReaderList ( ) [inline]
void ESM::ESMReader::getHExact ( void *  p,
int  size 
)
void ESM::ESMReader::getHNExact ( void *  p,
int  size,
const char *  name 
)
int64_t ESM::ESMReader::getHNLong ( const char *  name)
std::string ESM::ESMReader::getHNOString ( const char *  name)
template<typename X >
void ESM::ESMReader::getHNOT ( X &  x,
const char *  name 
) [inline]
template<typename X >
void ESM::ESMReader::getHNOT ( X &  x,
const char *  name,
int  size 
) [inline]
std::string ESM::ESMReader::getHNString ( const char *  name)
template<typename X >
void ESM::ESMReader::getHNT ( X &  x,
const char *  name 
) [inline]
template<typename X >
void ESM::ESMReader::getHNT ( X &  x,
const char *  name,
int  size 
) [inline]
std::string ESM::ESMReader::getHString ( )
template<typename X >
void ESM::ESMReader::getHT ( X &  x) [inline]
template<typename X >
void ESM::ESMReader::getHT ( X &  x,
int  size 
) [inline]
const int ESM::ESMReader::getIndex ( ) [inline]
void ESM::ESMReader::getName ( NAME name) [inline]
uint64_t ESM::ESMReader::getOffset ( ) [inline]
void ESM::ESMReader::getRecHeader ( ) [inline]
void ESM::ESMReader::getRecHeader ( uint32_t &  flags)
unsigned int ESM::ESMReader::getRecordFlags ( ) [inline]

Get record flags of last record.

std::string ESM::ESMReader::getString ( int  size)
void ESM::ESMReader::getSubHeaderIs ( int  size)

Get sub header and check the size

void ESM::ESMReader::getSubNameIs ( const char *  name)
uint32_t ESM::ESMReader::getSubSize ( ) const [inline]
template<typename X >
void ESM::ESMReader::getT ( X &  x) [inline]
void ESM::ESMReader::getUint ( uint32_t &  u) [inline]
int ESM::ESMReader::getVer ( ) const [inline]
bool ESM::ESMReader::hasMoreRecs ( ) const [inline]
bool ESM::ESMReader::hasMoreSubs ( ) const [inline]
bool ESM::ESMReader::isNextSub ( const char *  name)

Checks if the next sub record name matches the parameter. If it does, it is read into 'subName' just as if getSubName() was called. If not, the read name will still be available for future calls to getSubName(), isNextSub() and getSubNameIs().

void ESM::ESMReader::open ( Ogre::DataStreamPtr  _esm,
const std::string &  name 
)

Load ES file from a new stream, parses the header. Closes the currently open file first, if any.

void ESM::ESMReader::open ( const std::string &  file)
void ESM::ESMReader::openRaw ( Ogre::DataStreamPtr  _esm,
const std::string &  name 
)

Raw opening. Opens the file and sets everything up but doesn't parse the header.

void ESM::ESMReader::openRaw ( const std::string &  file)

Restore a previously saved context

const NAME& ESM::ESMReader::retSubName ( ) const [inline]

Sets font encoder for ESM strings.

void ESM::ESMReader::setGlobalReaderList ( std::vector< ESMReader > *  list) [inline]
void ESM::ESMReader::setIndex ( const int  index) [inline]
void ESM::ESMReader::skip ( int  bytes) [inline]
void ESM::ESMReader::skipHSubSize ( int  size)

Member Data Documentation

std::vector<char> ESM::ESMReader::mBuffer [private]
Ogre::DataStreamPtr ESM::ESMReader::mEsm [private]
unsigned int ESM::ESMReader::mRecordFlags [private]

The documentation for this class was generated from the following files: