aboutsummaryrefslogtreecommitdiff
path: root/include/cru/common/platform/unix
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2023-10-05 21:41:32 +0800
committercrupest <crupest@outlook.com>2023-10-05 21:41:32 +0800
commita5d07d55ef4395a5836fd0d2cd86b94290cb2d07 (patch)
tree93559c7402df97171b84e43a67aef82d36552da1 /include/cru/common/platform/unix
parentc1f491712ab071030ed8ca9587c896ca2856ab97 (diff)
downloadcru-a5d07d55ef4395a5836fd0d2cd86b94290cb2d07.tar.gz
cru-a5d07d55ef4395a5836fd0d2cd86b94290cb2d07.tar.bz2
cru-a5d07d55ef4395a5836fd0d2cd86b94290cb2d07.zip
...
Diffstat (limited to 'include/cru/common/platform/unix')
-rw-r--r--include/cru/common/platform/unix/UnixFileStream.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/include/cru/common/platform/unix/UnixFileStream.h b/include/cru/common/platform/unix/UnixFileStream.h
index 0c8ef340..bf13358b 100644
--- a/include/cru/common/platform/unix/UnixFileStream.h
+++ b/include/cru/common/platform/unix/UnixFileStream.h
@@ -4,14 +4,14 @@
#ifdef CRU_PLATFORM_UNIX
-#include "../../String.h"
-#include "../../io/OpenFileFlag.h"
#include "../../io/Stream.h"
namespace cru::platform::unix {
class UnixFileStream : public io::Stream {
public:
- UnixFileStream(String path, io::OpenFileFlag flags);
+ UnixFileStream(const char* path, int oflag);
+ UnixFileStream(int fd, bool can_seek, bool can_read, bool can_write,
+ bool auto_close);
CRU_DELETE_COPY(UnixFileStream)
CRU_DELETE_MOVE(UnixFileStream)
@@ -36,10 +36,11 @@ class UnixFileStream : public io::Stream {
void CheckClosed();
private:
- String path_;
- io::OpenFileFlag flags_;
- int file_descriptor_;
- bool closed_ = false;
+ int file_descriptor_; // -1 for no file descriptor
+ bool can_seek_;
+ bool can_read_;
+ bool can_write_;
+ bool auto_close_;
};
} // namespace cru::platform::unix