This library contains classes and functions for manipulation of the Windows Registry.
The Windows registry is a hierarchical database wherein nodes contain values and sub-nodes. A node is known as a key, and the values are known as, er, values. The Windows Registry Library provides a suite of classes that represent these entities and provide facilities for accessing, enumerating and modifying them:
Namespaces | |
namespace | winstl::registry_util |
Internal/implementation namespace containing shared handles. | |
Classes | |
class | registry_exception |
Root exception thrown by the Windows Registry Library. More... | |
class | key_not_duplicated_exception |
Indicates that a registry key could not be duplicated. More... | |
class | wrong_value_type_exception |
Indicates a registry value type mismatch. More... | |
class | access_denied_exception |
Indicates insufficient rights to access a registry key. More... | |
class | basic_reg_key |
Represents a registry key, and provides methods for manipulating its values and sub-keys. More... | |
class | basic_reg_key_sequence |
Presents an STL-like sequence interface over the sub-keys of a given registry key. More... | |
class | basic_reg_key_sequence_iterator |
Iterator for the basic_reg_key_sequence class. More... | |
struct | reg_traits |
Traits for accessing the correct registry functions for a given character type. More... | |
class | reg_blob |
Represents a binary registry value. More... | |
class | basic_reg_value |
Represents a registry value, providing methods for accessing the value in different types. More... | |
class | basic_reg_value_sequence |
Presents an STL-like sequence interface over the values of a given registry key. More... | |
class | basic_reg_value_sequence_iterator |
Iterator for the basic_reg_value_sequence class. More... | |
struct | shared_handle |
[IMPLEMENTATION] Non-monitoring shared registry key context More... | |
struct | monitored_shared_handle |
[IMPLEMENTATION] Monitoring shared registry key context More... | |
Typedefs | |
typedef basic_reg_key< char, reg_traits< char > , processheap_allocator< char > > | reg_key_a |
Specialisation of the basic_reg_key template for the ANSI character type char . | |
typedef basic_reg_key< wchar_t, reg_traits< wchar_t > , processheap_allocator < wchar_t > > | reg_key_w |
Specialisation of the basic_reg_key template for the Unicode character type wchar_t . | |
typedef basic_reg_key< TCHAR, reg_traits< TCHAR > , processheap_allocator< TCHAR > > | reg_key |
Specialisation of the basic_reg_key template for the Win32 character type TCHAR . | |
typedef basic_reg_key_sequence < char, reg_traits< char > , processheap_allocator< char > > | reg_key_sequence_a |
Specialisation of the basic_reg_key_sequence template for the ANSI character type char . | |
typedef basic_reg_key_sequence < wchar_t, reg_traits< wchar_t > , processheap_allocator < wchar_t > > | reg_key_sequence_w |
Specialisation of the basic_reg_key_sequence template for the Unicode character type wchar_t . | |
typedef basic_reg_key_sequence < TCHAR, reg_traits< TCHAR > , processheap_allocator< TCHAR > > | reg_key_sequence |
Specialisation of the basic_reg_key_sequence template for the Win32 character type TCHAR . | |
typedef basic_reg_value< char, reg_traits< char > , processheap_allocator< char > > | reg_value_a |
Specialisation of the basic_reg_value template for the ANSI character type char . | |
typedef basic_reg_value < wchar_t, reg_traits< wchar_t > , processheap_allocator < wchar_t > > | reg_value_w |
Specialisation of the basic_reg_value template for the Unicode character type wchar_t . | |
typedef basic_reg_value< TCHAR, reg_traits< TCHAR > , processheap_allocator< TCHAR > > | reg_value |
Specialisation of the basic_reg_value template for the Win32 character type TCHAR . | |
typedef basic_reg_value_sequence< char, reg_traits< char > , processheap_allocator< char > > | reg_value_sequence_a |
Specialisation of the basic_reg_value_sequence template for the ANSI character type char . | |
typedef basic_reg_value_sequence < wchar_t, reg_traits< wchar_t > , processheap_allocator < wchar_t > > | reg_value_sequence_w |
Specialisation of the basic_reg_value_sequence template for the Unicode character type wchar_t . | |
typedef basic_reg_value_sequence < TCHAR, reg_traits< TCHAR > , processheap_allocator< TCHAR > > | reg_value_sequence |
Specialisation of the basic_reg_value_sequence template for the Win32 character type TCHAR . | |
Functions | |
template<typename C> | |
LONG | reg_get_string_value (HKEY hkey, C const *name, C *buffer, size_t &cchBuffer) |
Gets the contents of a registry key's string value into a caller-supplied buffer. | |
template<typename C> | |
LONG | reg_get_dword_value (HKEY hkey, C const *name, DWORD &value) |
Gets the contents of a registry key's DWORD value into a caller-supplied variable. | |
template<typename C, typename T, typename A> | |
HKEY | get_handle (basic_reg_key< C, T, A > const &key) |
[Shim function] Returns the corresponding registry handle of an instance of winstl::basic_reg_key basic_reg_key. | |
Variables | |
const size_t | CCH_REG_API_AUTO_BUFFER = 512 |
Number of characters in internal buffer of auto_buffer used throughout the Registry library. |
typedef basic_reg_key<TCHAR, reg_traits<TCHAR>, processheap_allocator<TCHAR> > reg_key |
Specialisation of the basic_reg_key template for the Win32 character type TCHAR
.
typedef basic_reg_key< char , reg_traits< char >, processheap_allocator< char > > reg_key_a |
Specialisation of the basic_reg_key template for the ANSI character type char
.
typedef basic_reg_key_sequence<TCHAR, reg_traits<TCHAR>, processheap_allocator<TCHAR> > reg_key_sequence |
Specialisation of the basic_reg_key_sequence template for the Win32 character type TCHAR
.
typedef basic_reg_key_sequence< char , reg_traits< char >, processheap_allocator< char > > reg_key_sequence_a |
Specialisation of the basic_reg_key_sequence template for the ANSI character type char
.
typedef basic_reg_key_sequence< wchar_t , reg_traits< wchar_t >, processheap_allocator< wchar_t > > reg_key_sequence_w |
Specialisation of the basic_reg_key_sequence template for the Unicode character type wchar_t
.
typedef basic_reg_key< wchar_t , reg_traits< wchar_t >, processheap_allocator< wchar_t > > reg_key_w |
Specialisation of the basic_reg_key template for the Unicode character type wchar_t
.
typedef basic_reg_value<TCHAR, reg_traits<TCHAR>, processheap_allocator<TCHAR> > reg_value |
Specialisation of the basic_reg_value template for the Win32 character type TCHAR
.
typedef basic_reg_value< char , reg_traits< char >, processheap_allocator< char > > reg_value_a |
Specialisation of the basic_reg_value template for the ANSI character type char
.
typedef basic_reg_value_sequence<TCHAR, reg_traits<TCHAR>, processheap_allocator<TCHAR> > reg_value_sequence |
Specialisation of the basic_reg_value_sequence template for the Win32 character type TCHAR
.
typedef basic_reg_value_sequence< char , reg_traits< char >, processheap_allocator< char > > reg_value_sequence_a |
Specialisation of the basic_reg_value_sequence template for the ANSI character type char
.
typedef basic_reg_value_sequence< wchar_t , reg_traits< wchar_t >, processheap_allocator< wchar_t > > reg_value_sequence_w |
Specialisation of the basic_reg_value_sequence template for the Unicode character type wchar_t
.
typedef basic_reg_value< wchar_t , reg_traits< wchar_t >, processheap_allocator< wchar_t > > reg_value_w |
Specialisation of the basic_reg_value template for the Unicode character type wchar_t
.
HKEY winstl::get_handle | ( | basic_reg_key< C, T, A > const & | key | ) | [inline] |
[Shim function] Returns the corresponding registry handle of an instance of winstl::basic_reg_key basic_reg_key.
key | The basic_reg_key instance. |
References basic_reg_key::get_key_handle().
LONG winstl::reg_get_dword_value | ( | HKEY | hkey, | |
C const * | name, | |||
DWORD & | value | |||
) | [inline] |
Gets the contents of a registry key's DWORD value into a caller-supplied variable.
hkey | [in] Handle of the key whose values will be retrieved | |
name | [in] The name of the value. May be NULL or the empty string to access the key's default value | |
value | [out] The value's value. |
ERROR_SUCCESS (==0) | The function completed successfully | |
any other value | The function failed, and the error code indicates why |
value
is unchanged. LONG winstl::reg_get_string_value | ( | HKEY | hkey, | |
C const * | name, | |||
C * | buffer, | |||
size_t & | cchBuffer | |||
) | [inline] |
Gets the contents of a registry key's string value into a caller-supplied buffer.
hkey | [in] Handle of the key whose values will be retrieved | |
name | [in] The name of the value. May be NULL or the empty string to access the key's default value | |
buffer | [in] Pointer to the caller-allocated buffer into which the value's string result will be written. | |
cchBuffer | [inout] Specifies the size of the buffer parameter and receives the number of bytes required for the whole value (including the string's nul-terminating character). |
ERROR_SUCCESS (==0) | The function completed successfully | |
any other value | The function failed, and the error code indicates why |
const size_t CCH_REG_API_AUTO_BUFFER = 512 |
Number of characters in internal buffer of auto_buffer used throughout the Registry library.