From 91d06ae2fc6114d870ab76a05c1268a6ee417415 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Sat, 25 Jul 2020 02:17:48 +0300 Subject: libcamera: file: Use Flags<> class for open flags Use the newly introduced Flags<> class to store a bitfield of File::OpenMode in a type-safe way. The existing File::OpenMode enum is renamed to File::OpenModeFlag to free the File::OpenMode for the Flags<> type alias. Signed-off-by: Laurent Pinchart Reviewed-by: Jacopo Mondi --- include/libcamera/base/file.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/libcamera/base/file.h b/include/libcamera/base/file.h index 452a658b..eebb2402 100644 --- a/include/libcamera/base/file.h +++ b/include/libcamera/base/file.h @@ -30,13 +30,15 @@ public: using MapFlags = Flags; - enum OpenMode { + enum OpenModeFlag { NotOpen = 0, ReadOnly = (1 << 0), WriteOnly = (1 << 1), ReadWrite = ReadOnly | WriteOnly, }; + using OpenMode = Flags; + File(const std::string &name); File(); ~File(); -- cgit v1.2.1