mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-26 18:35:20 +00:00
Inline a couple of methods in esmreader.cpp
This commit is contained in:
parent
4dad58b806
commit
cff11fbca9
@ -7,11 +7,6 @@ namespace ESM
|
||||
|
||||
using namespace Misc;
|
||||
|
||||
std::string ESMReader::getName() const
|
||||
{
|
||||
return mCtx.filename;
|
||||
}
|
||||
|
||||
ESM_Context ESMReader::getContext()
|
||||
{
|
||||
// Update the file position before returning
|
||||
@ -29,11 +24,6 @@ ESMReader::ESMReader()
|
||||
clearCtx();
|
||||
}
|
||||
|
||||
int ESMReader::getFormat() const
|
||||
{
|
||||
return mHeader.mFormat;
|
||||
}
|
||||
|
||||
void ESMReader::restoreContext(const ESM_Context &rc)
|
||||
{
|
||||
// Reopen the file if necessary
|
||||
@ -181,11 +171,6 @@ bool ESMReader::peekNextSub(const char *name)
|
||||
return mCtx.subName == name;
|
||||
}
|
||||
|
||||
void ESMReader::cacheSubName()
|
||||
{
|
||||
mCtx.subCached = true;
|
||||
}
|
||||
|
||||
// Read subrecord name. This gets called a LOT, so I've optimized it
|
||||
// slightly.
|
||||
void ESMReader::getSubName()
|
||||
@ -340,19 +325,4 @@ void ESMReader::fail(const std::string &msg)
|
||||
throw std::runtime_error(ss.str());
|
||||
}
|
||||
|
||||
void ESMReader::setEncoder(ToUTF8::Utf8Encoder* encoder)
|
||||
{
|
||||
mEncoder = encoder;
|
||||
}
|
||||
|
||||
size_t ESMReader::getFileOffset() const
|
||||
{
|
||||
return mEsm->tellg();
|
||||
}
|
||||
|
||||
void ESMReader::skip(int bytes)
|
||||
{
|
||||
mEsm->seekg(getFileOffset()+bytes);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -36,10 +36,10 @@ public:
|
||||
const std::string getDesc() const { return mHeader.mData.desc; }
|
||||
const std::vector<Header::MasterData> &getGameFiles() const { return mHeader.mMaster; }
|
||||
const Header& getHeader() const { return mHeader; }
|
||||
int getFormat() const;
|
||||
int getFormat() const { return mHeader.mFormat; };
|
||||
const NAME &retSubName() const { return mCtx.subName; }
|
||||
uint32_t getSubSize() const { return mCtx.leftSub; }
|
||||
std::string getName() const;
|
||||
std::string getName() const {return mCtx.filename; };
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
@ -73,7 +73,7 @@ public:
|
||||
void openRaw(const std::string &filename);
|
||||
|
||||
/// Get the current position in the file. Make sure that the file has been opened!
|
||||
size_t getFileOffset() const;
|
||||
size_t getFileOffset() const { return mEsm->tellg(); };
|
||||
|
||||
// This is a quick hack for multiple esm/esp files. Each plugin introduces its own
|
||||
// terrain palette, but ESMReader does not pass a reference to the correct plugin
|
||||
@ -185,7 +185,7 @@ public:
|
||||
bool peekNextSub(const char* name);
|
||||
|
||||
// Store the current subrecord name for the next call of getSubName()
|
||||
void cacheSubName();
|
||||
void cacheSubName() {mCtx.subCached = true; };
|
||||
|
||||
// Read subrecord name. This gets called a LOT, so I've optimized it
|
||||
// slightly.
|
||||
@ -247,13 +247,13 @@ public:
|
||||
// them from native encoding to UTF8 in the process.
|
||||
std::string getString(int size);
|
||||
|
||||
void skip(int bytes);
|
||||
void skip(int bytes) { mEsm->seekg(getFileOffset()+bytes); };
|
||||
|
||||
/// Used for error handling
|
||||
void fail(const std::string &msg);
|
||||
|
||||
/// Sets font encoder for ESM strings
|
||||
void setEncoder(ToUTF8::Utf8Encoder* encoder);
|
||||
void setEncoder(ToUTF8::Utf8Encoder* encoder) { mEncoder = encoder; };
|
||||
|
||||
/// Get record flags of last record
|
||||
unsigned int getRecordFlags() { return mRecordFlags; }
|
||||
|
Loading…
x
Reference in New Issue
Block a user