diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2020-07-25 02:17:48 +0300 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2021-08-03 10:55:26 +0300 |
commit | 49862904f6cc707d300fab079ffe8173bf24d5d4 (patch) | |
tree | dae3f1d10c0eb7370ff7d948c356c5c012d11484 /include | |
parent | f7c6b1228bb0073ebdcab04599e96de0ace31064 (diff) |
libcamera: file: Use Flags<> class for map flags
Use the newly introduced Flags<> class to store a bitfield of
File::MapFlag in a type-safe way.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/libcamera/base/file.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/include/libcamera/base/file.h b/include/libcamera/base/file.h index 7dd1559d..452a658b 100644 --- a/include/libcamera/base/file.h +++ b/include/libcamera/base/file.h @@ -15,6 +15,7 @@ #include <libcamera/base/private.h> #include <libcamera/base/class.h> +#include <libcamera/base/flags.h> #include <libcamera/base/span.h> namespace libcamera { @@ -27,6 +28,8 @@ public: MapPrivate = (1 << 0), }; + using MapFlags = Flags<MapFlag>; + enum OpenMode { NotOpen = 0, ReadOnly = (1 << 0), @@ -57,7 +60,7 @@ public: ssize_t write(const Span<const uint8_t> &data); Span<uint8_t> map(off_t offset = 0, ssize_t size = -1, - MapFlag flags = MapNoOption); + MapFlags flags = MapNoOption); bool unmap(uint8_t *addr); static bool exists(const std::string &name); |