diff options
author | kleines Filmröllchen <malu.bertsch@gmail.com> | 2021-06-24 23:50:01 +0200 |
---|---|---|
committer | Ali Mohammad Pur <Ali.mpfard@gmail.com> | 2021-06-25 20:48:14 +0430 |
commit | 463a645d373958503e6960798f37765beec8cc6c (patch) | |
tree | 3f501751a18e33468fe4afffd6b9026df1b2a387 /Userland | |
parent | 988763c0efaa0d588f84da5699ca264f3456d882 (diff) | |
download | serenity-463a645d373958503e6960798f37765beec8cc6c.zip |
LibCore: Add InputFileStream::seek
As a file is able to seek(), InputFileStreams can delegate the seek()
easily. This allows for seeking to specific locations in the file.
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/Libraries/LibCore/FileStream.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Userland/Libraries/LibCore/FileStream.h b/Userland/Libraries/LibCore/FileStream.h index c538b906f4..7d8dd164b7 100644 --- a/Userland/Libraries/LibCore/FileStream.h +++ b/Userland/Libraries/LibCore/FileStream.h @@ -63,6 +63,11 @@ public: return true; } + bool seek(size_t offset, SeekMode whence = SeekMode::SetPosition) + { + return m_file->seek(offset, whence); + } + bool discard_or_error(size_t count) override { return m_file->seek(count, SeekMode::FromCurrentPosition); } bool unreliable_eof() const override { return m_file->eof(); } |