Nebula
Loading...
Searching...
No Matches
Win32::Win32Registry Class Reference

#include <win32registry.h>

Detailed Description

A simple wrapper class to access the Win32 registry.

NOTE: using this class restricts your code to the Win32 platform.

Public Types

enum  RootKey { ClassesRoot , CurrentUser , LocalMachine , Users }
 key enumeration More...
 

Static Public Member Functions

static bool Exists (const Util::String &vendor, const Util::String &key, const Util::String &name)
 return true if a setting exists (uses CurrentUser as RootKey)
 
static bool WriteString (const Util::String &vendor, const Util::String &key, const Util::String &name, const Util::String &value)
 write a settings entry (uses CurrentUser as RootKey)
 
static Util::String ReadString (const Util::String &vendor, const Util::String &key, const Util::String &name)
 read a string registry entry, the string will be UTF-8 encoded!
 
static bool Delete (const Util::String &vendor, const Util::String &key)
 delete a setting (and all its contained values), uses CurrentUser as RootKey
 
static bool Exists (RootKey rootKey, const Util::String &key, const Util::String &name)
 these are Win32 Specific!
 
static bool WriteString (RootKey rootKey, const Util::String &key, const Util::String &name, const Util::String &value)
 write a registry entry
 
static Util::String ReadString (RootKey rootKey, const Util::String &key, const Util::String &name)
 read a string registry entry, the string will be UTF-8 encoded!
 
static int ReadInt (RootKey rootKey, const Util::String &key, const Util::String &name)
 read an int registry entry
 
static bool Delete (RootKey rootKey, const Util::String &key)
 delete a registry key (and all its contained values)
 
static RootKey AsRootKey (const Util::String &str)
 convert rootkey from string
 

Static Private Member Functions

static HKEY RootKeyToWinKeyHandle (RootKey rootKey)
 convert RootKey enum into Win32 key handle
 

Member Enumeration Documentation

◆ RootKey

key enumeration

Enumerator
ClassesRoot 
CurrentUser 
LocalMachine 
Users 

Member Function Documentation

◆ AsRootKey()

Win32Registry::RootKey Win32::Win32Registry::AsRootKey ( const Util::String & str)
static

convert rootkey from string

Converts a string (all capitals, e.g.

HKEY_CURRENT_USER) into a RootKey value.

◆ Delete() [1/2]

bool Win32::Win32Registry::Delete ( const Util::String & vendor,
const Util::String & key )
static

delete a setting (and all its contained values), uses CurrentUser as RootKey

This deletes a complete registry key with all its values.

◆ Delete() [2/2]

bool Win32::Win32Registry::Delete ( RootKey rootKey,
const Util::String & key )
static

delete a registry key (and all its contained values)

This deletes a complete registry key with all its values.

◆ Exists() [1/2]

bool Win32::Win32Registry::Exists ( const Util::String & vendor,
const Util::String & key,
const Util::String & name )
static

return true if a setting exists (uses CurrentUser as RootKey)

Return true if a specific entry exists in the registry.

◆ Exists() [2/2]

bool Win32::Win32Registry::Exists ( RootKey rootKey,
const Util::String & key,
const Util::String & name )
static

these are Win32 Specific!

Return true if a specific entry exists in the registry.

return true if a registry entry exists

To check only for the existence of a key without the contained value, pass an empty 'name' string.

◆ ReadInt()

int Win32::Win32Registry::ReadInt ( RootKey rootKey,
const Util::String & key,
const Util::String & name )
static

read an int registry entry

Get an int value from the registry.

Fails hard if the key doesn't exists (use the Exists() method to make sure that the key exists!).

◆ ReadString() [1/2]

String Win32::Win32Registry::ReadString ( const Util::String & vendor,
const Util::String & key,
const Util::String & name )
static

read a string registry entry, the string will be UTF-8 encoded!

Get a string value from the registry.

Fails hard if the key doesn't exists (use the Exists() method to make sure that the key exists!). NOTE that this method returns an UTF-8 encoded string!

◆ ReadString() [2/2]

String Win32::Win32Registry::ReadString ( RootKey rootKey,
const Util::String & key,
const Util::String & name )
static

read a string registry entry, the string will be UTF-8 encoded!

Get a string value from the registry.

Fails hard if the key doesn't exists (use the Exists() method to make sure that the key exists!). NOTE that this method returns an UTF-8 encoded string!

◆ RootKeyToWinKeyHandle()

HKEY Win32::Win32Registry::RootKeyToWinKeyHandle ( RootKey rootKey)
staticprivate

convert RootKey enum into Win32 key handle

Convert a RootKey value into a Win32 key handle.

◆ WriteString() [1/2]

bool Win32::Win32Registry::WriteString ( const Util::String & vendor,
const Util::String & key,
const Util::String & name,
const Util::String & value )
static

write a settings entry (uses CurrentUser as RootKey)

Set a key value in the registry.

This will create the key if it doesn't exist.

◆ WriteString() [2/2]

bool Win32::Win32Registry::WriteString ( RootKey rootKey,
const Util::String & key,
const Util::String & name,
const Util::String & value )
static

write a registry entry

Set a key value in the registry.

This will create the key if it doesn't exist.


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