mirror of
https://github.com/OpenMW/openmw.git
synced 2025-03-01 06:09:42 +00:00
Read when need to skip few bytes
This commit is contained in:
parent
7ebf9a3c45
commit
6481324eb1
1 changed files with 8 additions and 1 deletions
|
@ -265,7 +265,14 @@ public:
|
||||||
// them from native encoding to UTF8 in the process.
|
// them from native encoding to UTF8 in the process.
|
||||||
std::string getString(int size);
|
std::string getString(int size);
|
||||||
|
|
||||||
void skip(int bytes) { mEsm->seekg(getFileOffset()+bytes); };
|
void skip(std::size_t bytes)
|
||||||
|
{
|
||||||
|
char buffer[4096];
|
||||||
|
if (bytes > std::size(buffer))
|
||||||
|
mEsm->seekg(getFileOffset() + bytes);
|
||||||
|
else
|
||||||
|
mEsm->read(buffer, bytes);
|
||||||
|
}
|
||||||
|
|
||||||
/// Used for error handling
|
/// Used for error handling
|
||||||
[[noreturn]] void fail(const std::string &msg);
|
[[noreturn]] void fail(const std::string &msg);
|
||||||
|
|
Loading…
Reference in a new issue