aboutsummaryrefslogtreecommitdiff
path: root/include/cru/common/io/BufferStream.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/cru/common/io/BufferStream.h')
-rw-r--r--include/cru/common/io/BufferStream.h17
1 files changed, 7 insertions, 10 deletions
diff --git a/include/cru/common/io/BufferStream.h b/include/cru/common/io/BufferStream.h
index 16ba999b..5ebff546 100644
--- a/include/cru/common/io/BufferStream.h
+++ b/include/cru/common/io/BufferStream.h
@@ -59,21 +59,18 @@ struct BufferStreamOptions {
class BufferStream : public Stream {
public:
BufferStream(const BufferStreamOptions& options);
-
~BufferStream() override;
- bool CanSeek() override;
- Index Seek(Index offset, SeekOrigin origin = SeekOrigin::Current) override;
+ CRU_STREAM_IMPLEMENT_CLOSE_BY_DO_CLOSE
- bool CanRead() override;
- Index Read(std::byte* buffer, Index offset, Index size) override;
- using Stream::Read;
+ void SetEof();
- bool CanWrite() override;
- Index Write(const std::byte* buffer, Index offset, Index size) override;
- using Stream::Write;
+ protected:
+ Index DoRead(std::byte* buffer, Index offset, Index size) override;
+ Index DoWrite(const std::byte* buffer, Index offset, Index size) override;
- void SetEof();
+ private:
+ void DoClose();
private:
Index block_size_;