Browse Source

MF_1_1_8 (1.1.16.1):
o respect registry HKEY difference between _LOCAL_MACHINE settings and _CURRENT_USER
o allow selection of different HKEY

Joseph Lee 18 years ago
parent
commit
87e65af730
1 changed files with 14 additions and 8 deletions
  1. 14 8
      panda/src/express/windowsRegistry.h

+ 14 - 8
panda/src/express/windowsRegistry.h

@@ -32,28 +32,34 @@
 //               and stores them in Unicode (and conversely reconverts
 //               and stores them in Unicode (and conversely reconverts
 //               them on retrieval).
 //               them on retrieval).
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
-class EXPCL_PANDAEXPRESS WindowsRegistry {
+class EXPCL_PANDAEXPRESS WindowsRegistry
+{
 PUBLISHED:
 PUBLISHED:
+  enum RegLevel {
+      rl_machine = 0,
+      rl_user = 1
+  };
+
   static bool set_string_value(const string &key, const string &name,
   static bool set_string_value(const string &key, const string &name,
-                               const string &value);
-  static bool set_int_value(const string &key, const string &name, int value);
+                               const string &value, RegLevel rl = rl_machine);
+  static bool set_int_value(const string &key, const string &name, int value, RegLevel rl = rl_machine);
 
 
   enum Type {
   enum Type {
     T_none,
     T_none,
     T_int,
     T_int,
     T_string,
     T_string,
   };
   };
-  static Type get_key_type(const string &key, const string &name);
+  static Type get_key_type(const string &key, const string &name, RegLevel rl = rl_machine);
   static string get_string_value(const string &key, const string &name,
   static string get_string_value(const string &key, const string &name,
-                                 const string &default_value);
+                                 const string &default_value, RegLevel rl = rl_machine);
   static int get_int_value(const string &key, const string &name,
   static int get_int_value(const string &key, const string &name,
-                           int default_value);
+                           int default_value, RegLevel rl = rl_machine);
 
 
 private:
 private:
   static bool do_set(const string &key, const string &name,
   static bool do_set(const string &key, const string &name,
-                     int data_type, const void *data, int data_length);
+                     int data_type, const void *data, int data_length, const RegLevel rl);
   static bool do_get(const string &key, const string &name,
   static bool do_get(const string &key, const string &name,
-                     int &data_type, string &data);
+                     int &data_type, string &data, const RegLevel rl);
   static string format_message(int error_code);
   static string format_message(int error_code);
 };
 };