From b09a5c7cea5b4eb32b3318c97b046f018b297d8c Mon Sep 17 00:00:00 2001 From: crupest Date: Tue, 3 Oct 2023 23:52:51 +0800 Subject: ... --- include/cru/common/io/OpenFileFlag.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'include/cru/common/io/OpenFileFlag.h') diff --git a/include/cru/common/io/OpenFileFlag.h b/include/cru/common/io/OpenFileFlag.h index bca1d737..fd8b6e2c 100644 --- a/include/cru/common/io/OpenFileFlag.h +++ b/include/cru/common/io/OpenFileFlag.h @@ -9,11 +9,38 @@ struct OpenFileFlagTag {}; using OpenFileFlag = Bitmask; struct OpenFileFlags { + /** + * \brief for reading + */ static constexpr OpenFileFlag Read{0x1}; + + /** + * \brief for writing + */ static constexpr OpenFileFlag Write{0x2}; + + /** + * \brief when writing, seek to end first + * Only effective for writing. + */ static constexpr OpenFileFlag Append{0x4}; + + /** + * \brief when writing, truncate the file to empty + * Only effective for writing. + * So the content is erased! Be careful! + */ static constexpr OpenFileFlag Truncate{0x8}; + + /** + * \brief when writing, if the file does not exist, create one + * Only effective for writing. + */ static constexpr OpenFileFlag Create{0x10}; + + /** + * TODO: ??? + */ static constexpr OpenFileFlag Exclusive{0x20}; }; } // namespace cru::io -- cgit v1.2.3