From 87e65af730793abd679973280ca05a7f9d673631 Mon Sep 17 00:00:00 2001 From: Joseph Lee Date: Wed, 12 Mar 2008 23:28:33 +0000 Subject: [PATCH] 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 --- panda/src/express/windowsRegistry.h | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/panda/src/express/windowsRegistry.h b/panda/src/express/windowsRegistry.h index 7d8de9cb65..3ac5c71622 100755 --- a/panda/src/express/windowsRegistry.h +++ b/panda/src/express/windowsRegistry.h @@ -32,28 +32,34 @@ // and stores them in Unicode (and conversely reconverts // them on retrieval). //////////////////////////////////////////////////////////////////// -class EXPCL_PANDAEXPRESS WindowsRegistry { +class EXPCL_PANDAEXPRESS WindowsRegistry +{ PUBLISHED: + enum RegLevel { + rl_machine = 0, + rl_user = 1 + }; + 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 { T_none, T_int, 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, - const string &default_value); + const string &default_value, RegLevel rl = rl_machine); static int get_int_value(const string &key, const string &name, - int default_value); + int default_value, RegLevel rl = rl_machine); private: 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, - int &data_type, string &data); + int &data_type, string &data, const RegLevel rl); static string format_message(int error_code); };