OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Public Attributes | Private Attributes | List of all members
ESM::ESMReader Class Reference

#include <esmreader.hpp>

Collaboration diagram for ESM::ESMReader:

Public Member Functions

 ESMReader ()
 
int getVer () const
 
int getRecordCount () const
 
float getFVer () const
 
const std::string getAuthor () const
 
const std::string getDesc () const
 
const std::vector
< Header::MasterData > & 
getGameFiles () const
 
const HeadergetHeader () const
 
int getFormat () const
 
const NAMEretSubName () const
 
uint32_t getSubSize () const
 
std::string getName () const
 
ESM_Context getContext ()
 
void restoreContext (const ESM_Context &rc)
 
void close ()
 
void openRaw (Files::IStreamPtr _esm, const std::string &name)
 
void open (Files::IStreamPtr _esm, const std::string &name)
 
void open (const std::string &file)
 
void openRaw (const std::string &filename)
 
size_t getFileOffset ()
 Get the current position in the file. Make sure that the file has been opened! More...
 
void setIndex (const int index)
 
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)
 
bool peekNextSub (const char *name)
 
void cacheSubName ()
 
void getSubName ()
 
bool isEmptyOrGetName ()
 
void skipHSub ()
 
void skipHSubSize (int size)
 
void skipHSubUntil (const char *name)
 
void getSubHeader ()
 
void getSubHeaderIs (int size)
 
NAME getRecName ()
 
void skipRecord ()
 
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)
 
void fail (const std::string &msg)
 Used for error handling. More...
 
void setEncoder (ToUTF8::Utf8Encoder *encoder)
 Sets font encoder for ESM strings. More...
 
unsigned int getRecordFlags ()
 Get record flags of last record. More...
 
size_t getFileSize () const
 

Public Attributes

int mIdx
 

Private Attributes

Files::IStreamPtr mEsm
 
ESM_Context mCtx
 
unsigned int mRecordFlags
 
std::vector< char > mBuffer
 
Header mHeader
 
std::vector< ESMReader > * mGlobalReaderList
 
ToUTF8::Utf8EncodermEncoder
 
size_t mFileSize
 

Constructor & Destructor Documentation

ESM::ESMReader::ESMReader ( )

Member Function Documentation

void ESM::ESMReader::cacheSubName ( )

Here is the caller graph for this function:

void ESM::ESMReader::close ( )

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Used for error handling.

Here is the call graph for this function:

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

Here is the call graph for this function:

Here is the caller graph for this function:

ESM_Context ESM::ESMReader::getContext ( )

Save the current file position and information in a ESM_Context struct

Here is the caller graph for this function:

const std::string ESM::ESMReader::getDesc ( ) const
inline

Here is the call graph for this function:

Here is the caller graph for this function:

void ESM::ESMReader::getExact ( void *  x,
int  size 
)

Here is the call graph for this function:

Here is the caller graph for this function:

size_t ESM::ESMReader::getFileOffset ( )

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

Here is the caller graph for this function:

size_t ESM::ESMReader::getFileSize ( ) const
inline

Here is the caller graph for this function:

int ESM::ESMReader::getFormat ( ) const

Here is the caller graph for this function:

float ESM::ESMReader::getFVer ( ) const
inline

Here is the caller graph for this function:

const std::vector<Header::MasterData>& ESM::ESMReader::getGameFiles ( ) const
inline

Here is the caller graph for this function:

std::vector<ESMReader>* ESM::ESMReader::getGlobalReaderList ( )
inline

Here is the caller graph for this function:

const Header& ESM::ESMReader::getHeader ( ) const
inline

Here is the caller graph for this function:

void ESM::ESMReader::getHExact ( void *  p,
int  size 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void ESM::ESMReader::getHNExact ( void *  p,
int  size,
const char *  name 
)

Here is the call graph for this function:

int64_t ESM::ESMReader::getHNLong ( const char *  name)

Here is the call graph for this function:

Here is the caller graph for this function:

std::string ESM::ESMReader::getHNOString ( const char *  name)

Here is the call graph for this function:

Here is the caller graph for this function:

template<typename X >
void ESM::ESMReader::getHNOT ( X &  x,
const char *  name 
)
inline

Here is the call graph for this function:

Here is the caller graph for this function:

template<typename X >
void ESM::ESMReader::getHNOT ( X &  x,
const char *  name,
int  size 
)
inline

Here is the call graph for this function:

std::string ESM::ESMReader::getHNString ( const char *  name)

Here is the call graph for this function:

Here is the caller graph for this function:

template<typename X >
void ESM::ESMReader::getHNT ( X &  x,
const char *  name 
)
inline

Here is the call graph for this function:

Here is the caller graph for this function:

template<typename X >
void ESM::ESMReader::getHNT ( X &  x,
const char *  name,
int  size 
)
inline

Here is the call graph for this function:

std::string ESM::ESMReader::getHString ( )

Here is the call graph for this function:

template<typename X >
void ESM::ESMReader::getHT ( X &  x)
inline

Here is the call graph for this function:

template<typename X >
void ESM::ESMReader::getHT ( X &  x,
int  size 
)
inline

Here is the call graph for this function:

int ESM::ESMReader::getIndex ( )
inline

Here is the caller graph for this function:

std::string ESM::ESMReader::getName ( ) const

Here is the caller graph for this function:

void ESM::ESMReader::getName ( NAME name)
inline

Here is the call graph for this function:

void ESM::ESMReader::getRecHeader ( )
inline

Here is the call graph for this function:

Here is the caller graph for this function:

void ESM::ESMReader::getRecHeader ( uint32_t &  flags)

Here is the call graph for this function:

NAME ESM::ESMReader::getRecName ( )

Here is the call graph for this function:

Here is the caller graph for this function:

int ESM::ESMReader::getRecordCount ( ) const
inline
unsigned int ESM::ESMReader::getRecordFlags ( )
inline

Get record flags of last record.

Here is the caller graph for this function:

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

Here is the call graph for this function:

Here is the caller graph for this function:

void ESM::ESMReader::getSubHeader ( )

Here is the call graph for this function:

Here is the caller graph for this function:

void ESM::ESMReader::getSubHeaderIs ( int  size)

Get sub header and check the size

Here is the call graph for this function:

Here is the caller graph for this function:

void ESM::ESMReader::getSubName ( )

Here is the call graph for this function:

void ESM::ESMReader::getSubNameIs ( const char *  name)

Here is the call graph for this function:

Here is the caller graph for this function:

uint32_t ESM::ESMReader::getSubSize ( ) const
inline

Here is the caller graph for this function:

template<typename X >
void ESM::ESMReader::getT ( X &  x)
inline

Here is the call graph for this function:

Here is the caller graph for this function:

void ESM::ESMReader::getUint ( uint32_t &  u)
inline

Here is the call graph for this function:

Here is the caller graph for this function:

int ESM::ESMReader::getVer ( ) const
inline

Here is the caller graph for this function:

bool ESM::ESMReader::hasMoreRecs ( ) const
inline

Here is the caller graph for this function:

bool ESM::ESMReader::hasMoreSubs ( ) const
inline
bool ESM::ESMReader::isEmptyOrGetName ( )

Here is the call graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

void ESM::ESMReader::open ( Files::IStreamPtr  _esm,
const std::string &  name 
)

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Here is the call graph for this function:

void ESM::ESMReader::openRaw ( Files::IStreamPtr  _esm,
const std::string &  name 
)

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Here is the call graph for this function:

Here is the caller graph for this function:

bool ESM::ESMReader::peekNextSub ( const char *  name)

Here is the call graph for this function:

Here is the caller graph for this function:

void ESM::ESMReader::restoreContext ( const ESM_Context rc)

Restore a previously saved context

Here is the call graph for this function:

Here is the caller graph for this function:

const NAME& ESM::ESMReader::retSubName ( ) const
inline
void ESM::ESMReader::setEncoder ( ToUTF8::Utf8Encoder encoder)

Sets font encoder for ESM strings.

Here is the caller graph for this function:

void ESM::ESMReader::setGlobalReaderList ( std::vector< ESMReader > *  list)
inline

Here is the call graph for this function:

Here is the caller graph for this function:

void ESM::ESMReader::setIndex ( const int  index)
inline

Here is the caller graph for this function:

void ESM::ESMReader::skip ( int  bytes)

Here is the call graph for this function:

Here is the caller graph for this function:

void ESM::ESMReader::skipHSub ( )

Here is the call graph for this function:

void ESM::ESMReader::skipHSubSize ( int  size)

Here is the call graph for this function:

Here is the caller graph for this function:

void ESM::ESMReader::skipHSubUntil ( const char *  name)

Here is the call graph for this function:

Here is the caller graph for this function:

void ESM::ESMReader::skipRecord ( )

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

std::vector<char> ESM::ESMReader::mBuffer
private
ESM_Context ESM::ESMReader::mCtx
private
ToUTF8::Utf8Encoder* ESM::ESMReader::mEncoder
private
Files::IStreamPtr ESM::ESMReader::mEsm
private
size_t ESM::ESMReader::mFileSize
private
std::vector<ESMReader>* ESM::ESMReader::mGlobalReaderList
private
Header ESM::ESMReader::mHeader
private
int ESM::ESMReader::mIdx
unsigned int ESM::ESMReader::mRecordFlags
private

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