OSDN Git Service

Registry functions: Optionally allow caller to force 32-bit registry view or 64-bit...
[mutilities/MUtilities.git] / include / MUtils / Registry.h
index b6c64e2..c38cdba 100644 (file)
@@ -1,6 +1,6 @@
 ///////////////////////////////////////////////////////////////////////////////
 // MuldeR's Utilities for Qt
-// Copyright (C) 2004-2015 LoRd_MuldeR <MuldeR2@GMX.de>
+// Copyright (C) 2004-2016 LoRd_MuldeR <MuldeR2@GMX.de>
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -49,6 +49,15 @@ namespace MUtils
                }
                reg_access_t;
 
+               //Regsitry scope
+               typedef enum
+               {
+                       scope_default = 0,
+                       scope_wow_x32 = 1,
+                       scope_wow_x64 = 2
+               }
+               reg_scope_t;
+
                //Forward declaration
                namespace Internal
                {
@@ -59,7 +68,7 @@ namespace MUtils
                class MUTILS_API RegistryKey
                {
                public:
-                       RegistryKey(const int &rootKey, const QString &keyName, const int &access);
+                       RegistryKey(const reg_root_t &rootKey, const QString &keyName, const reg_access_t &access, const reg_scope_t &scope = scope_default);
                        ~RegistryKey(void);
 
                        inline bool isOpen(void);
@@ -70,6 +79,7 @@ namespace MUtils
                        bool value_read(const QString &valueName, quint32 &value) const;
                        bool value_read(const QString &valueName, QString &value) const;
 
+                       bool enum_values (QStringList &list) const;
                        bool enum_subkeys(QStringList &list) const;
 
                private:
@@ -77,12 +87,14 @@ namespace MUtils
                };
 
                //Regsitry functions
-               MUTILS_API bool reg_value_write (const int &rootKey, const QString &keyName, const QString &valueName, const quint32 &value);
-               MUTILS_API bool reg_value_write (const int &rootKey, const QString &keyName, const QString &valueName, const QString &value);
-               MUTILS_API bool reg_value_read  (const int &rootKey, const QString &keyName, const QString &valueName, quint32       &value);
-               MUTILS_API bool reg_value_read  (const int &rootKey, const QString &keyName, const QString &valueName, QString       &value);
-               MUTILS_API bool reg_key_delete  (const int &rootKey, const QString &keyName);
-               MUTILS_API bool reg_enum_subkeys(const int &rootKey, const QString &keyName, QStringList &subkeys);
+               MUTILS_API bool reg_value_write (const reg_root_t &rootKey, const QString &keyName, const QString &valueName, const quint32 &value,           const reg_scope_t &scope = scope_default);
+               MUTILS_API bool reg_value_write (const reg_root_t &rootKey, const QString &keyName, const QString &valueName, const QString &value,           const reg_scope_t &scope = scope_default);
+               MUTILS_API bool reg_value_read  (const reg_root_t &rootKey, const QString &keyName, const QString &valueName, quint32       &value,           const reg_scope_t &scope = scope_default);
+               MUTILS_API bool reg_value_read  (const reg_root_t &rootKey, const QString &keyName, const QString &valueName, QString       &value,           const reg_scope_t &scope = scope_default);
+               MUTILS_API bool reg_key_exists  (const reg_root_t &rootKey, const QString &keyName,                                                           const reg_scope_t &scope = scope_default);
+               MUTILS_API bool reg_key_delete  (const reg_root_t &rootKey, const QString &keyName, const bool &recusrive = true, const bool &ascend = false, const reg_scope_t &scope = scope_default);
+               MUTILS_API bool reg_enum_values (const reg_root_t &rootKey, const QString &keyName, QStringList &list,                                        const reg_scope_t &scope = scope_default);
+               MUTILS_API bool reg_enum_subkeys(const reg_root_t &rootKey, const QString &keyName, QStringList &list,                                        const reg_scope_t &scope = scope_default);
        }
 }