Pārlūkot izejas kodu

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.
kleines Filmröllchen 4 gadi atpakaļ
vecāks
revīzija
463a645d37
1 mainītis faili ar 5 papildinājumiem un 0 dzēšanām
  1. 5 0
      Userland/Libraries/LibCore/FileStream.h

+ 5 - 0
Userland/Libraries/LibCore/FileStream.h

@@ -63,6 +63,11 @@ public:
         return true;
         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 discard_or_error(size_t count) override { return m_file->seek(count, SeekMode::FromCurrentPosition); }
 
 
     bool unreliable_eof() const override { return m_file->eof(); }
     bool unreliable_eof() const override { return m_file->eof(); }