aboutsummaryrefslogtreecommitdiff
path: root/include/cru/common/io/MemoryStream.h
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2024-10-06 13:57:39 +0800
committercrupest <crupest@outlook.com>2024-10-06 13:57:39 +0800
commitdfe62dcf8bcefc523b466e127c3edc4dc2756629 (patch)
tree1c751a14ba0da07ca2ff805633f97568060aa4c9 /include/cru/common/io/MemoryStream.h
parentf51eb955e188858272230a990565931e7403f23b (diff)
downloadcru-dfe62dcf8bcefc523b466e127c3edc4dc2756629.tar.gz
cru-dfe62dcf8bcefc523b466e127c3edc4dc2756629.tar.bz2
cru-dfe62dcf8bcefc523b466e127c3edc4dc2756629.zip
Rename common to base.
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