Base Framework
|
Registry key. More...
#include <base/extension/dk.sdu.mip/win32/Registry.h>
Inherits Object.
Public Types | |
enum | Root { CLASSES, MACHINE, USER, USERS, SYSTEM } |
enum | ValueType { UNSUPPORTED_VALUE, UNSPECIFIED_VALUE, BINARY_VALUE, INTEGER_VALUE, INTEGER_BE_VALUE, INTEGER_64_VALUE, LINK_VALUE, RESOURCE_LIST_VALUE, ENVIRONMENT_STRING_VALUE, STRING_SEQUENCE_VALUE, STRING_VALUE } |
enum | Access { READ, WRITE, READWRITE } |
Public Member Functions | |
RegistryKey () noexcept | |
RegistryKey (const RegistryKey ©) noexcept | |
RegistryKey & | operator= (const RegistryKey &assign) noexcept |
RegistryKey (const String &machine, Root root, const String &path, Access access) | |
RegistryKey (Root root, const String &path, Access access) | |
RegistryKey | open (const String &name, Access access) const |
RegistryKey | addSubkey (const String &name, Access access) |
void | close () |
bool | isValid () const |
Array< String > | getKeys () |
Array< String > | getValues () const |
bool | isEmpty () const |
bool | isKey (const String &name) const |
bool | isValue (const String &name) const |
Date | getLastModification () const |
Trustee | getOwner () const |
Trustee | getGroup () const |
AccessControlList | getACL () const |
void | setACL (const AccessControlList &acl) |
AnyValue | getValue (const String &name) const |
void | setValue (const String &name, const AnyValue &value) const |
uint32 | getInteger (const String &name) const |
void | setInteger (const String &name, uint32 value) |
String | getBinary (const String &name) const |
void | setBinary (const String &name, const char *buffer, unsigned int size) |
String | getString (const String &name) const |
void | setValue (const String &name, const String &value) |
Array< String > | getStringSequence (const String &name) const |
void | setValue (const String &name, const Array< String > &value) |
void | flush () |
bool | removeKey (const String &name, bool force=false) |
bool | removeValue (const String &name) |
ValueType | getTypeOfValue (const String &name) const |
unsigned int | getSize (const String &name) const |
Static Public Member Functions | |
static RegistryKey | getMachine () |
static RegistryKey | getUser () |
Registry key.
This class provides access to the Registry on Windows platforms. This class is an extension component of the Base Framework and is only available for WIN32 platforms.
The type of a value within the Registry.
Enumerator | |
---|---|
UNSUPPORTED_VALUE | Value type is not supported. |
UNSPECIFIED_VALUE | Value type is unspecified. |
BINARY_VALUE | Unspecified binary data. |
INTEGER_VALUE | A 32 bit integer in little endian byte order. |
INTEGER_BE_VALUE | A 32 bit integer in big endian byte order. |
INTEGER_64_VALUE | A 64 bit integer in little endian byte order. |
LINK_VALUE | A link. |
RESOURCE_LIST_VALUE | Device driver resource list. |
ENVIRONMENT_STRING_VALUE | String possibly containing references to environment variables. |
STRING_SEQUENCE_VALUE | A sequence of strings. |
STRING_VALUE | String value. |
|
noexcept |
Initializes key as invalid.
|
inlinenoexcept |
Initialization of handle from other handle.
extension::RegistryKey::RegistryKey | ( | const String & | machine, |
Root | root, | ||
const String & | path, | ||
Access | access | ||
) |
Opens the specified Registry key on a remote machine.
machine | The machine (e.g. "\\machine"). |
root | The Registry root (e.g. MACHINE). |
path | The path of the key within the specified root. |
access | The desired access (i.e. READ, WRITE, READWRITE). |
Opens the specified Registry key.
root | The Registry root (e.g. MACHINE). |
path | The path of the key within the specified root. |
access | The desired access (i.e. READ, WRITE, READWRITE). |
RegistryKey extension::RegistryKey::addSubkey | ( | const String & | name, |
Access | access | ||
) |
Adds a new subkey.
name | The name of the subkey. |
access | The desired access (i.e. READ, WRITE, READWRITE). |
void extension::RegistryKey::close | ( | ) |
Closes the handle to this key.
void extension::RegistryKey::flush | ( | ) |
Flushes any cached data to the Registry.
AccessControlList extension::RegistryKey::getACL | ( | ) | const |
Returns the ACL for the key.
Returns the value of a binary value (i.e. BINARY_VALUE and UNSPECIFIED_VALUE).
name | The name of the value. |
Trustee extension::RegistryKey::getGroup | ( | ) | const |
Returns the primary group of the key.
uint32 extension::RegistryKey::getInteger | ( | const String & | name | ) | const |
Returns the value of a 32 bit integer value (either INTEGER_VALUE or INTEGER_BE_VALUE)
Date extension::RegistryKey::getLastModification | ( | ) | const |
Returns the last modification time of the key.
|
static |
Returns a handle to the Registry of the local machine.
Trustee extension::RegistryKey::getOwner | ( | ) | const |
Returns the owner of the key.
unsigned int extension::RegistryKey::getSize | ( | const String & | name | ) | const |
Returns the size of the specified value.
name | The name of the value. |
Returns the value of a string value (i.e. STRING_VALUE or ENVIRONMENT_STRING_VALUE).
Returns the strings of a multi string value.
name | The name of the Registry value. |
Returns the type of the specified key or value.
name | The name of the value. |
|
static |
Returns a handle to the personal Registry of the current user.
Returns the content of the specified value.
name | The name of the value. |
Returns the names of the values within the key.
bool extension::RegistryKey::isEmpty | ( | ) | const |
Returns true if this key is empty.
bool extension::RegistryKey::isKey | ( | const String & | name | ) | const |
Returns true if the specified entry exists and is a key.
bool extension::RegistryKey::isValid | ( | ) | const |
Returns true if the handle is valid.
bool extension::RegistryKey::isValue | ( | const String & | name | ) | const |
Returns true if the specified entry exists and is a value.
RegistryKey extension::RegistryKey::open | ( | const String & | name, |
Access | access | ||
) | const |
Returns a handle to the specified subkey of this key.
name | The name of the subkey. |
access | The desired access (i.e. READ, WRITE, READWRITE). |
|
inlinenoexcept |
Assignment of handle by handle.
bool extension::RegistryKey::removeKey | ( | const String & | name, |
bool | force = false |
||
) |
Removes the specified subkey.
name | The name of the key to remove. |
force | Specifies if true to remove the even if not empty. The default is false. |
bool extension::RegistryKey::removeValue | ( | const String & | name | ) |
Removes the specified value from this key.
name | The name of the value. |
void extension::RegistryKey::setACL | ( | const AccessControlList & | acl | ) |
Sets the ACL of the key.
void extension::RegistryKey::setBinary | ( | const String & | name, |
const char * | buffer, | ||
unsigned int | size | ||
) |
Sets the value as a binary value (BINARY_VALUE).
name | The name of the value. |
buffer | The source of the value content. |
size | The number of bytes in the buffer. |
void extension::RegistryKey::setInteger | ( | const String & | name, |
uint32 | value | ||
) |
Sets the value as a 32 bit integer (INTEGER_VALUE).
name | The name of the value. |
content | The content of the value. |
Returns the content of the specified value.
name | The name of the value. |
value | The content of the Registry value. |
Sets the content of a multi string value.
name | The name of the Registry value. |
value | The desired mutil string content of the value. |