PixelLightAPI  .
Public Types | Public Member Functions
PLCore::Registry Class Reference

Registry key handle. More...

#include <Registry.h>

List of all members.

Public Types

enum  ERegistry { None = 0, Windows }
 Registry types. More...
enum  EKey {
  KeyNone = 0, KeyClassesRoot, KeyCurrentUser, KeyLocalMachine,
  KeyUsers
}
 Registry keys. More...
enum  EAccess { RegRead = 1, RegWrite = 2, RegNotify = 4 }
 Registry access. More...
enum  EType {
  TypeNone = 0, TypeBinary, TypeDWord, TypeString,
  TypeExpandString, TypeMultiString
}
 Registry value types. More...

Public Member Functions

PLCORE_API Registry ()
 Constructor.
PLCORE_API Registry (EKey nKey, const String &sSubKey, uint32 nAccess)
 Constructor.
PLCORE_API Registry (const Registry &cRegistry)
 Copy constructor.
PLCORE_API ~Registry ()
 Destructor.
ERegistry GetRegistryType () const
 Get type of registry.
bool Open (EKey nKey, const String &sSubKey, uint32 nAccess)
 Open registry key.
bool Create (EKey nKey, const String &sSubKey, uint32 nAccess)
 Create a new registry key.
bool Delete ()
 Delete the registry key.
void Close ()
 Close registry key.
EKey GetOpenKey () const
 Get ID of opened registry key.
String GetOpenSubKey () const
 Get name of opened sub-key.
uint32 GetOpenAccessMode () const
 Get access modes.
uint32 GetNumOfSubKeys () const
 Returns the number of sub-keys.
String GetSubKey (uint32 nIndex) const
 Get a sub-key of the opened registry key.
uint32 GetNumOfValues () const
 Returns the number of values.
String GetValue (uint32 nIndex) const
 Get a value of the opened registry key.
EType GetValueType (const String &sName) const
 Get the type of a given value.
String GetValueString (const String &sName) const
 Get a value of type string.
uint32 GetValueDWord (const String &sName) const
 Get a value of type 'dword'.
uint32 GetValueBinary (const String &sName, uint8 *pBuffer, uint32 nSize) const
 Get a value of type binary.
bool SetValueString (const String &sName, const String &sValue)
 Set a value of type string.
bool SetValueDWord (const String &sName, uint32 nValue)
 Set a value of type 'dword'.
bool SetValueBinary (const String &sName, const uint8 *pBuffer, uint32 nSize)
 Set a value of type binary.
void Flush ()
 Write all values to the registry.
Registryoperator= (const Registry &cRegistry)
 Copy operator.

Detailed Description

Registry key handle.

Remarks:
For Windows OS: Please note, if you access the registry on a 64 bit OS by using a 32 bit application 'Wow6432Node' may be added automatically by the OS. Usually this is no problem as long as you always use a 32 bit application to access this data - but if you have a 64 bit application and want to access the same registry data the 32 bit application is using you have to keep this topic in mind.

Member Enumeration Documentation

Registry types.

Enumerator:
None 

None

Windows 

Windows

Registry keys.

Enumerator:
KeyNone 

None

KeyClassesRoot 

Classes root

KeyCurrentUser 

Current user

KeyLocalMachine 

Local machine

KeyUsers 

Users

Registry access.

Enumerator:
RegRead 

Read

RegWrite 

Write

RegNotify 

Notify

Registry value types.

Enumerator:
TypeNone 

None

TypeBinary 

Binary

TypeDWord 

Double word

TypeString 

String

TypeExpandString 

Expand string

TypeMultiString 

Multi string


Constructor & Destructor Documentation

PLCORE_API PLCore::Registry::Registry ( EKey  nKey,
const String sSubKey,
uint32  nAccess 
)

Constructor.

Parameters:
[in]nKeyRegistry key
[in]sSubKeyName of subkey
[in]nAccessAccess modes (combination of 'EAccess' values)
PLCORE_API PLCore::Registry::Registry ( const Registry cRegistry)

Copy constructor.

Parameters:
[in]cRegistryRegistry handle to copy

Destructor.


Member Function Documentation

Get type of registry.

Returns:
Type of registry ('None' if no registry is available on your system!)
bool PLCore::Registry::Open ( EKey  nKey,
const String sSubKey,
uint32  nAccess 
) [inline]

Open registry key.

Parameters:
[in]nKeyRegistry key
[in]sSubKeyName of subkey
[in]nAccessAccess modes (combination of 'EAccess' values)
Returns:
'true' if all went fine, else 'false'
bool PLCore::Registry::Create ( EKey  nKey,
const String sSubKey,
uint32  nAccess 
) [inline]

Create a new registry key.

Parameters:
[in]nKeyRegistry key
[in]sSubKeyName of subkey
[in]nAccessAccess modes (combination of 'EAccess' values)
Returns:
'true' if all went fine, else 'false'
bool PLCore::Registry::Delete ( ) [inline]

Delete the registry key.

Returns:
'true' if all went fine, else 'false'
void PLCore::Registry::Close ( ) [inline]

Close registry key.

Get ID of opened registry key.

Returns:
Key ID

Get name of opened sub-key.

Returns:
Name of sub-key
uint32 PLCore::Registry::GetOpenAccessMode ( ) const [inline]

Get access modes.

Returns:
Access modes
uint32 PLCore::Registry::GetNumOfSubKeys ( ) const [inline]

Returns the number of sub-keys.

Returns:
Number of sub-keys
String PLCore::Registry::GetSubKey ( uint32  nIndex) const [inline]

Get a sub-key of the opened registry key.

Parameters:
[in]nIndexIndex of the sub-key
Returns:
Name of the sub-key, or "" if no more sub-keys are present
uint32 PLCore::Registry::GetNumOfValues ( ) const [inline]

Returns the number of values.

Returns:
Number of values
String PLCore::Registry::GetValue ( uint32  nIndex) const [inline]

Get a value of the opened registry key.

Parameters:
[in]nIndexIndex of the value
Returns:
Name of the value, or "" if no more values are present
Registry::EType PLCore::Registry::GetValueType ( const String sName) const [inline]

Get the type of a given value.

Parameters:
[in]sNameName of the value
Returns:
Type of the value
String PLCore::Registry::GetValueString ( const String sName) const [inline]

Get a value of type string.

Parameters:
[in]sNameName of the value
Returns:
String value
uint32 PLCore::Registry::GetValueDWord ( const String sName) const [inline]

Get a value of type 'dword'.

Get a value of type dword.

Parameters:
[in]sNameName of the value
Returns:
Value
uint32 PLCore::Registry::GetValueBinary ( const String sName,
uint8 *  pBuffer,
uint32  nSize 
) const [inline]

Get a value of type binary.

Parameters:
[in]sNameName of the value
[out]pBufferBuffer to receive the value, if a null pointer, returns the number of bytes required
[in]nSizeSize of the given buffer in bytes, ignored if 'pBuffer' is a null pointer
Returns:
Number of bytes written to the buffer
bool PLCore::Registry::SetValueString ( const String sName,
const String sValue 
) [inline]

Set a value of type string.

Parameters:
[in]sNameName of the value
[in]sValueString value to set
Returns:
'true' if all went fine, else 'false'
bool PLCore::Registry::SetValueDWord ( const String sName,
uint32  nValue 
) [inline]

Set a value of type 'dword'.

Set a value of type dword.

Parameters:
[in]sNameName of the value
[in]nValueValue to set
Returns:
'true' if all went fine, else 'false'
bool PLCore::Registry::SetValueBinary ( const String sName,
const uint8 *  pBuffer,
uint32  nSize 
) [inline]

Set a value of type binary.

Parameters:
[in]sNameName of the value
[in]pBufferBuffer containing the value to set (if a null pointer, the function fails)
[in]nSizeSize of the given buffer in bytes
Returns:
'true' if all went fine, else 'false'
void PLCore::Registry::Flush ( ) [inline]

Write all values to the registry.

Registry & PLCore::Registry::operator= ( const Registry cRegistry) [inline]

Copy operator.

Parameters:
[in]cRegistrySource registry to copy from
Returns:
Reference to this instance

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


PixelLight PixelLight 0.9.10-R1
Copyright (C) 2002-2011 by The PixelLight Team
Last modified Fri Dec 23 2011 15:51:15
The content of this PixelLight document is published under the
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported