diff options
Diffstat (limited to 'include/fud_file.hpp')
-rw-r--r-- | include/fud_file.hpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/include/fud_file.hpp b/include/fud_file.hpp index 6f1acbf..66719e4 100644 --- a/include/fud_file.hpp +++ b/include/fud_file.hpp @@ -38,7 +38,7 @@ enum class FileAccessMode : uint8_t ReadWrite = Read | Write }; -enum class OpenFlagEnum : uint16_t +enum class OpenFlagEnum : uint8_t { Append = 0x01, Truncate = Append << 1, @@ -91,7 +91,7 @@ class OpenFlags { return mode; } - constexpr uint32_t flags() const noexcept + [[nodiscard]] constexpr uint32_t flags() const noexcept { uint32_t openFlags = 0; openFlags |= static_cast<uint32_t>(hasFlag(OpenFlagEnum::Append)) * O_APPEND; @@ -105,7 +105,7 @@ class OpenFlags { return openFlags; } - constexpr bool hasFlag(OpenFlagEnum flag) const noexcept + [[nodiscard]] constexpr bool hasFlag(OpenFlagEnum flag) const noexcept { return (m_mask & static_cast<FlagType>(flag)) != 0; } @@ -142,7 +142,7 @@ class RegularFile { Result<size_t, FudStatus> size() const; - constexpr int fileDescriptor() const + [[nodiscard]] constexpr int fileDescriptor() const { return m_fd; } @@ -225,7 +225,7 @@ class BufferedRegularFile { Result<size_t, FudStatus> searchSubstring(StringView subString); - constexpr const RegularFile& file() const + [[nodiscard]] constexpr const RegularFile& file() const { return m_file; } |