diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/libcamera/base/file.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/include/libcamera/base/file.h b/include/libcamera/base/file.h index eebb2402..60851d38 100644 --- a/include/libcamera/base/file.h +++ b/include/libcamera/base/file.h @@ -23,14 +23,14 @@ namespace libcamera { class File { public: - enum MapFlag { - MapNoOption = 0, - MapPrivate = (1 << 0), + enum class MapFlag { + NoOption = 0, + Private = (1 << 0), }; using MapFlags = Flags<MapFlag>; - enum OpenModeFlag { + enum class OpenModeFlag { NotOpen = 0, ReadOnly = (1 << 0), WriteOnly = (1 << 1), @@ -62,7 +62,7 @@ public: ssize_t write(const Span<const uint8_t> &data); Span<uint8_t> map(off_t offset = 0, ssize_t size = -1, - MapFlags flags = MapNoOption); + MapFlags flags = MapFlag::NoOption); bool unmap(uint8_t *addr); static bool exists(const std::string &name); @@ -80,6 +80,9 @@ private: std::map<void *, size_t> maps_; }; +LIBCAMERA_FLAGS_ENABLE_OPERATORS(File::MapFlag) +LIBCAMERA_FLAGS_ENABLE_OPERATORS(File::OpenModeFlag) + } /* namespace libcamera */ #endif /* __LIBCAMERA_BASE_FILE_H__ */ |