diff options
| author | Yuqian Yang <crupest@crupest.life> | 2026-03-07 20:42:37 +0800 |
|---|---|---|
| committer | Yuqian Yang <crupest@crupest.life> | 2026-03-07 20:42:37 +0800 |
| commit | 38756822825e20eca3b9e01b735946175223d692 (patch) | |
| tree | fc2a495bfc0e082d5ed9a1642278ae6467fe2742 /include/cru/base/platform/win | |
| parent | 924f4b472712d0cfc55b81dcb3eaed3f8a478288 (diff) | |
| download | cru-38756822825e20eca3b9e01b735946175223d692.tar.gz cru-38756822825e20eca3b9e01b735946175223d692.tar.bz2 cru-38756822825e20eca3b9e01b735946175223d692.zip | |
Refactor stream.
Diffstat (limited to 'include/cru/base/platform/win')
| -rw-r--r-- | include/cru/base/platform/win/Stream.h | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/include/cru/base/platform/win/Stream.h b/include/cru/base/platform/win/Stream.h index 104b3bd7..9dd33d35 100644 --- a/include/cru/base/platform/win/Stream.h +++ b/include/cru/base/platform/win/Stream.h @@ -24,15 +24,11 @@ class CRU_BASE_API Win32HandleStream : public io::Stream { 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 DoClose() override; public: HANDLE GetHandle() { return handle_; } - CRU_STREAM_IMPLEMENT_CLOSE_BY_DO_CLOSE - - private: - void DoClose(); - private: HANDLE handle_; bool auto_close_; @@ -51,15 +47,11 @@ class CRU_BASE_API ComStream : public io::Stream { 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 DoClose() override; public: IStream* GetComStream() { return stream_; } - CRU_STREAM_IMPLEMENT_CLOSE_BY_DO_CLOSE - - private: - void DoClose(); - private: IStream* stream_; bool auto_release_; |
