34 #include "../api_core.h"
35 #include "databuffer.h"
43 class RegistryKey_Impl;
48 class CL_API_CORE RegistryKey
73 RegistryKey(PredefinedKey key,
const std::string &subkey,
unsigned int access_rights = KEY_ALL_ACCESS,
unsigned int create_flags = create_always);
75 RegistryKey(HKEY key);
86 bool is_null()
const {
return !impl; }
89 void throw_if_null()
const;
93 std::vector<std::string> get_subkey_names()
const;
95 std::vector<std::string> get_value_names()
const;
97 int get_value_int(
const std::string &name,
int default_value = 0)
const;
99 DataBuffer get_value_binary(
const std::string &name,
const DataBuffer &default_value = DataBuffer())
const;
101 std::string get_value_string(
const std::string &name,
const std::string &default_value = std::string())
const;
103 std::vector<std::string> get_value_multi_string(
const std::string &name,
const std::vector<std::string> &default_value = std::vector<std::string>())
const;
111 RegistryKey open_key(
const std::string &subkey,
unsigned int access_rights = KEY_ALL_ACCESS);
113 RegistryKey create_key(
const std::string &subkey,
unsigned int access_rights = KEY_ALL_ACCESS, CreateFlags create_flags = create_always);
115 void delete_key(
const std::string &subkey,
bool recursive);
117 static void delete_key(PredefinedKey key,
const std::string &subkey,
bool recursive);
119 void set_value_int(
const std::string &name,
int value);
121 void set_value_binary(
const std::string &name,
const DataBuffer &value);
123 void set_value_string(
const std::string &name,
const std::string &value);
127 void delete_value(
const std::string &name);
135 std::shared_ptr<RegistryKey_Impl> impl;