UTF8 - Simple Library for Internationalization
|
Wrappers for Windows registry functions. More...
Functions | |
LSTATUS | utf8::RegCreateKey (HKEY key, const std::string &subkey, HKEY &result, DWORD options, REGSAM sam, const SECURITY_ATTRIBUTES *psa, DWORD *disp) |
Convenience wrapper for RegCreateKeyEx | |
LSTATUS | utf8::RegOpenKey (HKEY key, const std::string &subkey, HKEY &result, REGSAM sam, bool link) |
Wrapper for RegOpenKeyEx | |
LSTATUS | utf8::RegDeleteKey (HKEY key, const std::string &subkey, REGSAM sam) |
Wrapper for RegDeleteKeyEx or RegDeleteKey | |
LSTATUS | utf8::RegDeleteValue (HKEY key, const std::string &value) |
Wrapper for RegDeleteValue | |
LSTATUS | utf8::RegDeleteTree (HKEY key, const std::string &subkey) |
Wrapper for RegDeleteTree | |
LSTATUS | utf8::RegRenameKey (HKEY key, const std::string &subkey, const std::string &new_name) |
Wrapper for RegRenameKey | |
LSTATUS | utf8::RegSetValue (HKEY key, const std::string &value, DWORD type, const void *data, DWORD size) |
Wrapper for RegSetValueEx | |
LSTATUS | utf8::RegSetValue (HKEY key, const std::string &value, const std::string &data) |
Convenience Wrapper for RegSetValueEx for string data. | |
LSTATUS | utf8::RegSetValue (HKEY key, const std::string &value, const std::vector< std::string > &data) |
Convenience Wrapper for RegSetValueEx for vector of string data. | |
LSTATUS | utf8::RegQueryValue (HKEY key, const std::string &value, DWORD *type, void *data, DWORD *size) |
Wrapper for RegQueryValueEx | |
LSTATUS | utf8::RegGetValue (HKEY key, const std::string &subkey, const std::string &value, DWORD flags, void *data, DWORD *size, DWORD *type) |
Wrapper for RegGetValue | |
LSTATUS | utf8::RegGetValue (HKEY key, const std::string &subkey, const std::string &value, std::string &data, bool expand) |
Retrieves a string from a registry key value using the RegGetValue function. | |
LSTATUS | utf8::RegGetValue (HKEY key, const std::string &subkey, const std::string &value, std::vector< std::string > &data) |
Retrieves a vector of strings from a registry key value using the RegGetValue function. | |
LSTATUS | utf8::RegEnumKey (HKEY key, DWORD index, std::string &name, DWORD maxlen, FILETIME *last_write_time) |
Wrapper for RegEnumKeyEx | |
LSTATUS | utf8::RegEnumKey (HKEY key, std::vector< std::string > &names) |
Enumerate all subkeys of a key. | |
LSTATUS | utf8::RegEnumValue (HKEY key, DWORD index, std::string &value, DWORD maxlen, DWORD *type, void *data, DWORD *data_len) |
Wrapper for RegEnumValue | |
LSTATUS | utf8::RegEnumValue (HKEY key, std::vector< std::string > &values) |
Enumerate all values of a key. | |
Wrappers for Windows registry functions.
For all these functions wide character strings arguments are replaced with UTF-8 encoded C++ strings.
LSTATUS utf8::RegCreateKey | ( | HKEY | key, |
const std::string & | subkey, | ||
HKEY & | result, | ||
DWORD | options, | ||
REGSAM | sam, | ||
const SECURITY_ATTRIBUTES * | psa, | ||
DWORD * | disp | ||
) |
Convenience wrapper for RegCreateKeyEx
key | handle to an open registry key |
subkey | name of a subkey that this function opens or creates |
result | newly created key handle |
options | option flags |
sam | access rights for the new key |
psa | pointer to SECURITY_ATTRIBUTES structure (can be NULL) |
disp | pointer to a flag showing if key was created (REG_CREATED_NEW_KEY) or opened (REG_OPENED_EXISTING_KEY). Can be NULL. |
LSTATUS utf8::RegDeleteKey | ( | HKEY | key, |
const std::string & | subkey, | ||
REGSAM | sam | ||
) |
Wrapper for RegDeleteKeyEx or RegDeleteKey
key | handle to an open registry key |
subkey | name of a subkey to delete |
sam | access mask specifies the platform-specific view of the registry:
|
If sam
is 0, this function invokes RegDeleteKey function, deleting the 32-bit key if the invoking application is 32-bit, or the 64-bit key if the invoking application is 64-bit. Otherwise it invokes the RegDeleteKeyEx function.
LSTATUS utf8::RegDeleteTree | ( | HKEY | key, |
const std::string & | subkey | ||
) |
Wrapper for RegDeleteTree
key | handle to an open registry key |
subkey | name of a subkey to delete |
If subkey
is empty, the key and all subkeys and values are deleted.
LSTATUS utf8::RegDeleteValue | ( | HKEY | key, |
const std::string & | value | ||
) |
Wrapper for RegDeleteValue
key | handle to an opened registry key |
value | name of the value to delete. |
If value
is the empty string, the function removes the default key value.
LSTATUS utf8::RegEnumKey | ( | HKEY | key, |
DWORD | index, | ||
std::string & | name, | ||
DWORD | maxlen, | ||
FILETIME * | last_write_time | ||
) |
Wrapper for RegEnumKeyEx
key | handle of an opened registry key |
index | enumeration index. Set to 0 for first subkey. |
name | name of enumerated subkey |
maxlen | maximum length (in characters) of subkey name |
last_write_time | pointer to variable that receives the last time the subkey was written. |
If maxlen
parameter is 0, the function uses RegQueryInfoKey function to determine the maximum length.
LSTATUS utf8::RegEnumKey | ( | HKEY | key, |
std::vector< std::string > & | names | ||
) |
Enumerate all subkeys of a key.
key | handle of an opened registry key |
names | vector of strings containing names of all enumerated subkeys |
LSTATUS utf8::RegEnumValue | ( | HKEY | key, |
DWORD | index, | ||
std::string & | value, | ||
DWORD | maxlen, | ||
DWORD * | type, | ||
void * | data, | ||
DWORD * | data_len | ||
) |
Wrapper for RegEnumValue
key | handle of an opened registry key |
index | enumeration index. Set to 0 for first subkey. |
value | name of enumerated value |
maxlen | maximum length (in characters) of value name |
type | pointer to type of data stored in the value |
data | pointer to data stored in that value |
data_len | pointer to size of data buffer in bytes |
If maxlen
parameter is 0, the function uses RegQueryInfoKey function to determine the maximum length of value name.
data_len
parameter can be NULL only if data
parameter is also NULL.
LSTATUS utf8::RegEnumValue | ( | HKEY | key, |
std::vector< std::string > & | values | ||
) |
Enumerate all values of a key.
key | handle of an opened registry key |
values | vector of strings containing the names of all enumerated values |
LSTATUS utf8::RegGetValue | ( | HKEY | key, |
const std::string & | subkey, | ||
const std::string & | value, | ||
DWORD | flags, | ||
void * | data, | ||
DWORD * | size, | ||
DWORD * | type | ||
) |
Wrapper for RegGetValue
key | handle to an open registry key |
subkey | path of the subkey from which the function retrieves the value |
value | name of the value to be retrieved. If empty, the function retrieves the type and data for the key's unnamed or default value |
flags | the flags that restrict the data type of value to be queried. |
data | pointer to data |
size | pointer to size data size (in bytes) |
type | pointer to type of data |
LSTATUS utf8::RegGetValue | ( | HKEY | key, |
const std::string & | subkey, | ||
const std::string & | value, | ||
std::string & | data, | ||
bool | expand | ||
) |
Retrieves a string from a registry key value using the RegGetValue function.
key | handle to an open registry key |
subkey | path of the subkey from which the function retrieves the value |
value | name of the value to be retrieved. If empty, the function retrieves the type and data for the key's unnamed or default value |
data | retrieved registry data |
expand | if false, the function does not expand the REG_EXPAND_SZ strings |
LSTATUS utf8::RegGetValue | ( | HKEY | key, |
const std::string & | subkey, | ||
const std::string & | value, | ||
std::vector< std::string > & | data | ||
) |
Retrieves a vector of strings from a registry key value using the RegGetValue function.
key | handle to an open registry key |
subkey | path of the subkey from which the function retrieves the value |
value | name of the value to be retrieved. If empty, the function retrieves the type and data for the key's unnamed or default value |
data | retrieved vector of strings |
LSTATUS utf8::RegOpenKey | ( | HKEY | key, |
const std::string & | subkey, | ||
HKEY & | result, | ||
REGSAM | sam, | ||
bool | link | ||
) |
Wrapper for RegOpenKeyEx
key | handle to an open registry key |
subkey | name of a subkey that this function opens |
result | opened key handle |
sam | access rights for opened key |
link | set to true if key is a symbolic link |
LSTATUS utf8::RegQueryValue | ( | HKEY | key, |
const std::string & | value, | ||
DWORD * | type, | ||
void * | data, | ||
DWORD * | size | ||
) |
Wrapper for RegQueryValueEx
key | handle to an open registry key |
value | name of the value to be retrieved. If empty, the function retrieves the type and data for the key's unnamed or default value |
type | pointer to type of data |
data | pointer to data |
size | pointer to size data size (in bytes) |
LSTATUS utf8::RegRenameKey | ( | HKEY | key, |
const std::string & | subkey, | ||
const std::string & | new_name | ||
) |
Wrapper for RegRenameKey
key | handle to an open registry key |
subkey | name of a subkey to rename |
new_name | new subkey name |
LSTATUS utf8::RegSetValue | ( | HKEY | key, |
const std::string & | value, | ||
const std::string & | data | ||
) |
Convenience Wrapper for RegSetValueEx for string data.
key | handle to an open registry key |
value | name of the value to be set. If empty, the function sets the type and data for the key's unnamed or default value |
data | value to be set |
Value type is set to REG_SZ
and data is appended a terminating NULL character.
LSTATUS utf8::RegSetValue | ( | HKEY | key, |
const std::string & | value, | ||
const std::vector< std::string > & | data | ||
) |
Convenience Wrapper for RegSetValueEx for vector of string data.
key | handle to an open registry key |
value | name of the value to be set. If empty, the function sets the type and data for the key's unnamed or default value. |
data | value to be set |
Value type is set to REG_MULTI_SZ
and formatted accordingly, with two terminating NULL characters.
LSTATUS utf8::RegSetValue | ( | HKEY | key, |
const std::string & | value, | ||
DWORD | type, | ||
const void * | data, | ||
DWORD | size | ||
) |
Wrapper for RegSetValueEx
key | handle to an open registry key |
value | name of the value to be set. If empty, the function sets the type and data for the key's unnamed or default value |
type | the type of data |
data | pointer to data |
size | data size (in bytes) |