aboutsummaryrefslogtreecommitdiff
path: root/include/cru
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2023-10-05 22:11:38 +0800
committercrupest <crupest@outlook.com>2023-10-05 22:11:38 +0800
commit301b74c63deab5f09cc09d4edc07e0c86faa7cfa (patch)
tree8c98835eb5b775e95ac88db5bcd8173a1664ebc4 /include/cru
parent1550828518ff4719db88f35e088207816866a073 (diff)
downloadcru-301b74c63deab5f09cc09d4edc07e0c86faa7cfa.tar.gz
cru-301b74c63deab5f09cc09d4edc07e0c86faa7cfa.tar.bz2
cru-301b74c63deab5f09cc09d4edc07e0c86faa7cfa.zip
Remove WebFileStream.
Diffstat (limited to 'include/cru')
-rw-r--r--include/cru/common/platform/web/WebFileStream.h44
1 files changed, 0 insertions, 44 deletions
diff --git a/include/cru/common/platform/web/WebFileStream.h b/include/cru/common/platform/web/WebFileStream.h
deleted file mode 100644
index 76f3fa84..00000000
--- a/include/cru/common/platform/web/WebFileStream.h
+++ /dev/null
@@ -1,44 +0,0 @@
-#pragma once
-
-#include "../../PreConfig.h"
-
-#ifdef CRU_PLATFORM_EMSCRIPTEN
-
-#include "../../io/Stream.h"
-#include "cru/common/io/OpenFileFlag.h"
-
-namespace cru::platform::web {
-/**
- * \remark Web just hates filesystems. But luckily emscripten just creates a
- * good simulation of it. All we need to do is to use the C api and let
- * emscripten take care of it for us.
- */
-class WebFileStream : public io::Stream {
- public:
- WebFileStream(String path, io::OpenFileFlag flags);
-
- ~WebFileStream() override;
-
- public:
- bool CanSeek() override;
- Index Seek(Index offset, SeekOrigin origin = SeekOrigin::Current) override;
-
- bool CanRead() override;
- Index Read(std::byte* buffer, Index offset, Index size) override;
- using Stream::Read;
-
- bool CanWrite() override;
- Index Write(const std::byte* buffer, Index offset, Index size) override;
- using Stream::Write;
-
- void Close() override;
-
- private:
- String path_;
- io::OpenFileFlag flags_;
-
- FILE* file_;
-};
-} // namespace cru::platform::web
-
-#endif