clan::RegistryKey Class Reference - ClanLib SDK
Description: clan::RegistryKey Class Reference

Public Types | Public Member Functions | Static Public Member Functions | List of all members
clan::RegistryKey Class Reference
clanCore System

Registry key class. More...

`#include <registry_key.h>`

## Public Types
enum | CreateFlags { create_always = 0 , create_new = 1 , create_volatile = 2 }
enum | PredefinedKey { key_classes_root , key_current_config , key_current_user , key_local_machine , key_users }

## Public Member Functions
| RegistryKey ()
| RegistryKey (HKEY key)
| RegistryKey (PredefinedKey key, const std::string &subkey, unsigned int access_rights=KEY_ALL_ACCESS, unsigned int create_flags=create_always)
| ~RegistryKey ()
RegistryKey | create_key (const std::string &subkey, unsigned int access_rights=KEY_ALL_ACCESS, CreateFlags create_flags=create_always)
void | delete_key (const std::string &subkey, bool recursive)
void | delete_value (const std::string &name)
HKEY | get_key () const
std::vector< std::string > | get_subkey_names () const
DataBuffer | get_value_binary (const std::string &name, const DataBuffer &default_value=DataBuffer()) const
int | get_value_int (const std::string &name, int default_value=0) const
std::vector< std::string > | get_value_multi_string (const std::string &name, const std::vector< std::string > &default_value=std::vector< std::string >()) const
std::vector< std::string > | get_value_names () const
std::string | get_value_string (const std::string &name, const std::string &default_value=std::string()) const
bool | is_null () const
| Returns true if this object is invalid.
RegistryKey | open_key (const std::string &subkey, unsigned int access_rights=KEY_ALL_ACCESS)
void | set_value_binary (const std::string &name, const DataBuffer &value)
void | set_value_int (const std::string &name, int value)
void | set_value_string (const std::string &name, const std::string &value)
void | throw_if_null () const
| Throw an exception if this object is invalid.

## Static Public Member Functions
static void | delete_key (PredefinedKey key, const std::string &subkey, bool recursive)

## Detailed Description

Registry key class.

This class is only available on Windows.

!group=Core/System! !header=core.h!

## Member Enumeration Documentation

## ◆ CreateFlags

enum clan::RegistryKey::CreateFlags

Enumerator
create_always |
create_new |
create_volatile |

## ◆ PredefinedKey

enum clan::RegistryKey::PredefinedKey

Enumerator
key_classes_root |
key_current_config |
key_current_user |
key_local_machine |
key_users |

## Constructor & Destructor Documentation

## ◆ RegistryKey() [1/3]

clan::RegistryKey::RegistryKey | ( |  | ) |

## ◆ RegistryKey() [2/3]

clan::RegistryKey::RegistryKey | ( | PredefinedKey | key,
|  | const std::string & | subkey,
|  | unsigned int | access_rights = KEY_ALL_ACCESS,
|  | unsigned int | create_flags = create_always )

## ◆ RegistryKey() [3/3]

clan::RegistryKey::RegistryKey | ( | HKEY | key | ) |

## ◆ ~RegistryKey()

clan::RegistryKey::~RegistryKey | ( |  | ) |

## Member Function Documentation

## ◆ create_key()

RegistryKey clan::RegistryKey::create_key | ( | const std::string & | subkey,
|  | unsigned int | access_rights = KEY_ALL_ACCESS,
|  | CreateFlags | create_flags = create_always )

## ◆ delete_key() [1/2]

void clan::RegistryKey::delete_key | ( | const std::string & | subkey,
|  | bool | recursive )

## ◆ delete_key() [2/2]

static void clan::RegistryKey::delete_key | ( | PredefinedKey | key,
|  | const std::string & | subkey,
|  | bool | recursive )
| static

## ◆ delete_value()

void clan::RegistryKey::delete_value | ( | const std::string & | name | ) |

## ◆ get_key()

HKEY clan::RegistryKey::get_key | ( |  | ) | const

## ◆ get_subkey_names()

std::vector< std::string > clan::RegistryKey::get_subkey_names | ( |  | ) | const

## ◆ get_value_binary()

DataBuffer clan::RegistryKey::get_value_binary | ( | const std::string & | name,
|  | const DataBuffer & | default_value = DataBuffer() ) const

## ◆ get_value_int()

int clan::RegistryKey::get_value_int | ( | const std::string & | name,
|  | int | default_value = 0 ) const

## ◆ get_value_multi_string()

std::vector< std::string > clan::RegistryKey::get_value_multi_string | ( | const std::string & | name,
|  | const std::vector< std::string > & | default_value = std::vector< std::string >() ) const

## ◆ get_value_names()

std::vector< std::string > clan::RegistryKey::get_value_names | ( |  | ) | const

## ◆ get_value_string()

std::string clan::RegistryKey::get_value_string | ( | const std::string & | name,
|  | const std::string & | default_value = std::string() ) const

## ◆ is_null()

bool clan::RegistryKey::is_null | ( |  | ) | const
| inline

Returns true if this object is invalid.

## ◆ open_key()

RegistryKey clan::RegistryKey::open_key | ( | const std::string & | subkey,
|  | unsigned int | access_rights = KEY_ALL_ACCESS )

## ◆ set_value_binary()

void clan::RegistryKey::set_value_binary | ( | const std::string & | name,
|  | const DataBuffer & | value )

## ◆ set_value_int()

void clan::RegistryKey::set_value_int | ( | const std::string & | name,
|  | int | value )

## ◆ set_value_string()

void clan::RegistryKey::set_value_string | ( | const std::string & | name,
|  | const std::string & | value )

## ◆ throw_if_null()

void clan::RegistryKey::throw_if_null | ( |  | ) | const

Throw an exception if this object is invalid.

The documentation for this class was generated from the following file:

- registry_key.h