BinaryReader: add a way to seek into the file.
This commit is contained in:
parent
76210e147a
commit
975f471a68
2 changed files with 6 additions and 0 deletions
|
@ -45,6 +45,10 @@ auto BinaryReader::position() -> Long {
|
||||||
return _ftelli64(_file);
|
return _ftelli64(_file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto BinaryReader::seek(Long position) -> bool {
|
||||||
|
return _fseeki64(_file, position, SEEK_SET) == 0;
|
||||||
|
}
|
||||||
|
|
||||||
void BinaryReader::closeFile() {
|
void BinaryReader::closeFile() {
|
||||||
std::fclose(_file);
|
std::fclose(_file);
|
||||||
_file = nullptr;
|
_file = nullptr;
|
||||||
|
|
|
@ -36,6 +36,8 @@ class BinaryReader {
|
||||||
auto eof() -> bool;
|
auto eof() -> bool;
|
||||||
auto position() -> Long;
|
auto position() -> Long;
|
||||||
|
|
||||||
|
auto seek(Long position) -> bool;
|
||||||
|
|
||||||
void closeFile();
|
void closeFile();
|
||||||
|
|
||||||
auto readChar(char& value) -> bool;
|
auto readChar(char& value) -> bool;
|
||||||
|
|
Loading…
Reference in a new issue