summaryrefslogtreecommitdiff
path: root/include/registry
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-04-08 12:18:03 +0200
committerNoel Grandin <noel@peralex.com>2015-04-09 08:41:11 +0200
commit1bdbe0b475464402716c1c304d28376f1c37d820 (patch)
tree4ed184ad2b1ce13e3214d15eaed180c7e38bc073 /include/registry
parent1b0c1943788f6083b27a1e5a4d6d76373f08459b (diff)
convert REG_ constants to scoped enum
Change-Id: I11d92218c5e0678d497f8964723033e2bd8b3300
Diffstat (limited to 'include/registry')
-rw-r--r--include/registry/registry.h2
-rw-r--r--include/registry/registry.hxx2
-rw-r--r--include/registry/regtype.h20
3 files changed, 14 insertions, 10 deletions
diff --git a/include/registry/registry.h b/include/registry/registry.h
index b4add7f9bd53..15e6c9dd42ff 100644
--- a/include/registry/registry.h
+++ b/include/registry/registry.h
@@ -411,7 +411,7 @@ REG_DLLPUBLIC sal_Bool REGISTRY_CALLTYPE reg_isReadOnly(RegHandle hReg);
@param registryName points to a null terminated string specifying the name of the registry.
@param phRegistry points to a hanle of the opened registry if the function succeeds otherwise NULL.
- @param accessMode specifies the accessmode of the registry, REG_READONLY or REG_READWRITE.
+ @param accessMode specifies the accessmode of the registry, RegAccessMode::READONLY or RegAccessMode::READWRITE.
@return REG_NO_ERROR if succeeds else an error code.
*/
REG_DLLPUBLIC RegError REGISTRY_CALLTYPE reg_openRegistry(rtl_uString* registryName,
diff --git a/include/registry/registry.hxx b/include/registry/registry.hxx
index de511c0fb39f..7f023a0504a9 100644
--- a/include/registry/registry.hxx
+++ b/include/registry/registry.hxx
@@ -136,7 +136,7 @@ public:
If the registry already points to a valid registry, the old registry will be closed.
@param registryName specifies a registry name.
- @param accessMode specifies the access mode for the registry, REG_READONLY or REG_READWRITE.
+ @param accessMode specifies the access mode for the registry, RegAccessMode::READONLY or RegAccessMode::READWRITE.
@return REG_NO_ERROR if succeeds else an error code.
*/
inline RegError open(const rtl::OUString& registryName,
diff --git a/include/registry/regtype.h b/include/registry/regtype.h
index 79c3d993537d..9ae76a8a4288 100644
--- a/include/registry/regtype.h
+++ b/include/registry/regtype.h
@@ -21,6 +21,7 @@
#define INCLUDED_REGISTRY_REGTYPE_H
#include <sal/types.h>
+#include <o3tl/typed_flags_set.hxx>
/// defines the type of a registry handle used in the C API.
typedef void* RegHandle;
@@ -34,15 +35,18 @@ typedef void* RegValue;
/** defines the open/access mode of the registry.
Two modes are valid:
- -REG_READONLY allows readonly access
- -REG_READWRITE allows read and write access
+ -READONLY allows readonly access
+ -READWRITE allows read and write access
*/
-typedef sal_uInt16 RegAccessMode;
-
-/// Flag to specify the open mode of a registry. This mode allows readonly access.
-#define REG_READONLY 0x0001
-/// Flag to specify the open mode of a registry. This mode allows read and write access.
-#define REG_READWRITE 0x0002
+enum class RegAccessMode
+{
+ READONLY = 0x0001, /// This mode allows readonly access.
+ READWRITE = 0x0002 /// This mode allows read and write access.
+};
+namespace o3tl
+{
+ template<> struct typed_flags<RegAccessMode> : is_typed_flags<RegAccessMode, 0x07> {};
+}
/** defines the type of a registry key.