00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef WINDOWSREGISTRY_H
00016 #define WINDOWSREGISTRY_H
00017
00018 #include "pandabase.h"
00019
00020
00021 #ifdef WIN32_VC
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 class EXPCL_PANDAEXPRESS WindowsRegistry
00032 {
00033 PUBLISHED:
00034 enum RegLevel {
00035 rl_machine = 0,
00036 rl_user = 1
00037 };
00038
00039 static bool set_string_value(const string &key, const string &name,
00040 const string &value, RegLevel rl = rl_machine);
00041 static bool set_int_value(const string &key, const string &name, int value, RegLevel rl = rl_machine);
00042
00043 enum Type {
00044 T_none,
00045 T_int,
00046 T_string,
00047 };
00048 static Type get_key_type(const string &key, const string &name, RegLevel rl = rl_machine);
00049 static string get_string_value(const string &key, const string &name,
00050 const string &default_value, RegLevel rl = rl_machine);
00051 static int get_int_value(const string &key, const string &name,
00052 int default_value, RegLevel rl = rl_machine);
00053
00054 private:
00055 static bool do_set(const string &key, const string &name,
00056 int data_type, const void *data, int data_length, const RegLevel rl);
00057 static bool do_get(const string &key, const string &name,
00058 int &data_type, string &data, const RegLevel rl);
00059 static string format_message(int error_code);
00060 };
00061
00062 #endif // WIN32_VC
00063
00064 #endif