Add stream buffering (WIP)

This commit is contained in:
SirLynix
2022-04-09 18:22:57 +02:00
parent 2b66ea1e90
commit 22f58fdbf5
14 changed files with 291 additions and 189 deletions

View File

@@ -40,7 +40,6 @@ namespace Nz
bool Exists() const;
UInt64 GetCursorPos() const override;
std::filesystem::path GetDirectory() const override;
std::filesystem::path GetFileName() const;
std::filesystem::path GetPath() const override;
@@ -51,8 +50,6 @@ namespace Nz
bool Open(OpenModeFlags openMode = OpenMode::NotOpen);
bool Open(const std::filesystem::path& filePath, OpenModeFlags openMode = OpenMode::NotOpen);
bool SetCursorPos(CursorPosition pos, Int64 offset = 0);
bool SetCursorPos(UInt64 offset) override;
bool SetFile(const std::filesystem::path& filePath);
bool SetSize(UInt64 size);
@@ -65,6 +62,8 @@ namespace Nz
private:
void FlushStream() override;
std::size_t ReadBlock(void* buffer, std::size_t size) override;
bool SeekStreamCursor(UInt64 offset) override;
UInt64 TellStreamCursor() const override;
std::size_t WriteBlock(const void* buffer, std::size_t size) override;
std::filesystem::path m_filePath;