From dfe62dcf8bcefc523b466e127c3edc4dc2756629 Mon Sep 17 00:00:00 2001 From: crupest Date: Sun, 6 Oct 2024 13:57:39 +0800 Subject: Rename common to base. --- include/cru/common/io/ProxyStream.h | 42 ------------------------------------- 1 file changed, 42 deletions(-) delete mode 100644 include/cru/common/io/ProxyStream.h (limited to 'include/cru/common/io/ProxyStream.h') diff --git a/include/cru/common/io/ProxyStream.h b/include/cru/common/io/ProxyStream.h deleted file mode 100644 index 42ec9dfd..00000000 --- a/include/cru/common/io/ProxyStream.h +++ /dev/null @@ -1,42 +0,0 @@ -#pragma once - -#include "Stream.h" - -#include - -namespace cru::io { -struct ProxyStreamHandlers { - std::function seek; - std::function read; - std::function write; - std::function flush; - - /** - * @brief This method will be only called once when `Close` is called or the - * stream is destructed. - */ - std::function close; -}; - -class ProxyStream : public Stream { - public: - explicit ProxyStream(ProxyStreamHandlers handlers); - - ~ProxyStream() override; - - public: - CRU_STREAM_IMPLEMENT_CLOSE_BY_DO_CLOSE - - protected: - Index DoSeek(Index offset, SeekOrigin origin) override; - Index DoRead(std::byte* buffer, Index offset, Index size) override; - Index DoWrite(const std::byte* buffer, Index offset, Index size) override; - void DoFlush() override; - - private: - void DoClose(); - - private: - ProxyStreamHandlers handlers_; -}; -} // namespace cru::io -- cgit v1.2.3