aboutsummaryrefslogtreecommitdiff
path: root/include/cru/common/io/MemoryStream.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/cru/common/io/MemoryStream.h')
-rw-r--r--include/cru/common/io/MemoryStream.h36
1 files changed, 0 insertions, 36 deletions
diff --git a/include/cru/common/io/MemoryStream.h b/include/cru/common/io/MemoryStream.h
deleted file mode 100644
index a1f90c3b..00000000
--- a/include/cru/common/io/MemoryStream.h
+++ /dev/null
@@ -1,36 +0,0 @@
-#pragma once
-
-#include "Stream.h"
-
-#include <functional>
-
-namespace cru::io {
-class CRU_BASE_API MemoryStream : public Stream {
- public:
- MemoryStream(
- std::byte* buffer, Index size, bool read_only = false,
- std::function<void(std::byte* buffer, Index size)> release_func = {});
-
- ~MemoryStream() override;
-
- public:
- void Close() override;
-
- std::byte* GetBuffer() const { return buffer_; }
-
- protected:
- Index DoSeek(Index offset, SeekOrigin origin) override;
- Index DoGetSize() override { return size_; }
- Index DoRead(std::byte* buffer, Index offset, Index size) override;
- Index DoWrite(const std::byte* buffer, Index offset, Index size) override;
-
- private:
- void DoClose();
-
- private:
- std::byte* buffer_;
- Index size_;
- Index position_;
- std::function<void(std::byte* buffer, Index size)> release_func_;
-};
-} // namespace cru::io