My Project
UDK 3.2.7 C/C++ API Reference
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Public Attributes | Friends | List of all members
RegistryKey Class Reference

RegistryKey reads or writes information of the underlying key in a registry. More...

#include <registry.hxx>

Public Member Functions

 RegistryKey ()
 Default constructor.
 RegistryKey (const RegistryKey &toCopy)
 Copy constructor.
 ~RegistryKey ()
 Destructor, close the key if it references an open one.
RegistryKeyoperator= (const RegistryKey &toAssign)
 Assign operator.
sal_Bool isValid () const
 checks if the key points to a valid registry key.
sal_Bool isReadOnly () const
 returns the access mode of the key.
inline::rtl::OUString getName ()
 returns the full qualified name of the key beginning with the rootkey.
RegError createKey (const ::rtl::OUString &keyName, RegistryKey &rNewKey)
 creates a new key or opens a key if the specified key already exists.
RegError openKey (const ::rtl::OUString &keyName, RegistryKey &rOpenKey)
 opens the specified key.
RegError openSubKeys (const ::rtl::OUString &keyName, RegistryKeyArray &rSubKeys)
 opens all subkeys of the specified key.
RegError getKeyNames (const ::rtl::OUString &keyName, RegistryKeyNames &rSubKeyNames)
 returns an array with the names of all subkeys of the specified key.
RegError closeSubKeys (RegistryKeyArray &rSubKeys)
 closes all keys specified in the array.
RegError deleteKey (const ::rtl::OUString &keyName)
 deletes the specified key.
RegError closeKey ()
 closes explicitly the current key
void releaseKey ()
 releases the current key
RegError setValue (const ::rtl::OUString &keyName, RegValueType valueType, RegValue pValue, sal_uInt32 valueSize)
 sets a value of a key.
RegError setLongListValue (const ::rtl::OUString &keyName, sal_Int32 *pValueList, sal_uInt32 len)
 sets a long list value of a key.
RegError setStringListValue (const ::rtl::OUString &keyName, sal_Char **pValueList, sal_uInt32 len)
 sets an ascii list value of a key.
RegError setUnicodeListValue (const ::rtl::OUString &keyName, sal_Unicode **pValueList, sal_uInt32 len)
 sets an unicode string list value of a key.
RegError getValueInfo (const ::rtl::OUString &keyName, RegValueType *pValueType, sal_uInt32 *pValueSize)
 gets info about type and size of a value.
RegError getValue (const ::rtl::OUString &keyName, RegValue pValue)
 gets the value of a key.
RegError getLongListValue (const ::rtl::OUString &keyName, RegistryValueList< sal_Int32 > &rValueList)
 gets a long list value of a key.
RegError getStringListValue (const ::rtl::OUString &keyName, RegistryValueList< sal_Char * > &rValueList)
 gets an ascii list value of a key.
RegError getUnicodeListValue (const ::rtl::OUString &keyName, RegistryValueList< sal_Unicode * > &rValueList)
 gets a unicode value of a key.
RegError createLink (const ::rtl::OUString &linkName, const ::rtl::OUString &linkTarget)
 used to create a link.
RegError deleteLink (const ::rtl::OUString &linkName)
 used to delete a link.
RegError getKeyType (const ::rtl::OUString &name, RegKeyType *pKeyType) const
 returns the type of the specified key.
RegError getLinkTarget (const ::rtl::OUString &linkName,::rtl::OUString &rLinkTarget) const
 used to return the target of a link.
RegError getResolvedKeyName (const ::rtl::OUString &keyName, sal_Bool firstLinkOnly,::rtl::OUString &rResolvedName) const
 resolves a keyname.
inline::rtl::OUString getRegistryName ()
 returns the name of the registry in which the key is defined.
Registry getRegistry () const
 returns the registry in which the key is defined.

Public Attributes

Registry m_registry
 stores the registry on which this key works
RegKeyHandle m_hImpl
 stores the current key handle of this key

Friends

class Registry

Detailed Description

RegistryKey reads or writes information of the underlying key in a registry.

Class is inline and use a load on call C-Api.

Constructor & Destructor Documentation

RegistryKey::RegistryKey ( )
inline

Default constructor.

RegistryKey::RegistryKey ( const RegistryKey toCopy)
inline

Copy constructor.

RegistryKey::~RegistryKey ( )
inline

Destructor, close the key if it references an open one.

Member Function Documentation

RegError RegistryKey::closeKey ( )
inline

closes explicitly the current key

RegError RegistryKey::closeSubKeys ( RegistryKeyArray rSubKeys)
inline

closes all keys specified in the array.

Parameters
rSubKeysreference a RegistryKeyArray which contains the open keys.
Returns
REG_NO_ERROR if succeeds else an error code.
RegError RegistryKey::createKey ( const ::rtl::OUString keyName,
RegistryKey rNewKey 
)
inline

creates a new key or opens a key if the specified key already exists.

The specified keyname is relativ to this key.

Parameters
keyNamespecifies the name of the key which will be opened or created.
rNewKeyreferences a RegistryKey which will be filled with the new or open key.
Returns
REG_NO_ERROR if succeeds else an error code.
RegError RegistryKey::createLink ( const ::rtl::OUString linkName,
const ::rtl::OUString linkTarget 
)
inline

used to create a link.

Deprecated:
Links are no longer supported.
Returns
REG_INVALID_LINK
RegError RegistryKey::deleteKey ( const ::rtl::OUString keyName)
inline

deletes the specified key.

Parameters
keyNamespecifies the name of the key which will be deleted.
Returns
REG_NO_ERROR if succeeds else an error code.
RegError RegistryKey::deleteLink ( const ::rtl::OUString linkName)
inline

used to delete a link.

Deprecated:
Links are no longer supported.
Returns
REG_INVALID_LINK
RegError RegistryKey::getKeyNames ( const ::rtl::OUString keyName,
RegistryKeyNames rSubKeyNames 
)
inline

returns an array with the names of all subkeys of the specified key.

The specified keyname is relativ to this key.

Parameters
keyNamespecifies the name of the key which subkey names will be returned.
rSubKeyNamesreference a RegistryKeyNames array which will be filled with the subkey names.
Returns
REG_NO_ERROR if succeeds else an error code.
RegError RegistryKey::getKeyType ( const ::rtl::OUString name,
RegKeyType pKeyType 
) const
inline

returns the type of the specified key.

Parameters
namespecifies the name of the key or link.
pKeyTypereturns the type of the key (always RG_KEYTYPE).
Returns
REG_NO_ERROR if succeeds else an error code.
RegError RegistryKey::getLinkTarget ( const ::rtl::OUString linkName,
::rtl::OUString rLinkTarget 
) const
inline

used to return the target of a link.

Deprecated:
Links are no longer supported.
Returns
REG_INVALID_LINK
RegError RegistryKey::getLongListValue ( const ::rtl::OUString keyName,
RegistryValueList< sal_Int32 > &  rValueList 
)
inline

gets a long list value of a key.

Parameters
keyNamespecifies the name of the key which value will be returned. If keyName is an empty string, the value is get from the key specified by hKey.
rValueListreferences a RegistryValueList which will be filled with the long values.
Returns
REG_NO_ERROR if succeeds else an error code.
rtl::OUString RegistryKey::getName ( )
inline

returns the full qualified name of the key beginning with the rootkey.

Registry RegistryKey::getRegistry ( ) const
inline

returns the registry in which the key is defined.

rtl::OUString RegistryKey::getRegistryName ( )
inline

returns the name of the registry in which the key is defined.

RegError RegistryKey::getResolvedKeyName ( const ::rtl::OUString keyName,
sal_Bool  firstLinkOnly,
::rtl::OUString rResolvedName 
) const
inline

resolves a keyname.

Parameters
keyNamespecifies the name of the key which will be resolved relativ to this key. The resolved name will be prefixed with the name of this key.
firstLinkOnlyignored
Returns
REG_NO_ERROR if succeeds else an error code.
RegError RegistryKey::getStringListValue ( const ::rtl::OUString keyName,
RegistryValueList< sal_Char * > &  rValueList 
)
inline

gets an ascii list value of a key.

Parameters
keyNamespecifies the name of the key which value will be returned. If keyName is an empty string, the value is get from the key specified by hKey.
rValueListreferences a RegistryValueList which will be filled with the ascii values.
Returns
REG_NO_ERROR if succeeds else an error code.
RegError RegistryKey::getUnicodeListValue ( const ::rtl::OUString keyName,
RegistryValueList< sal_Unicode * > &  rValueList 
)
inline

gets a unicode value of a key.

Parameters
keyNamespecifies the name of the key which value will be returned. If keyName is an empty string, the value is get from the key specified by hKey.
rValueListreference a RegistryValueList which will be filled with the unicode values.
Returns
REG_NO_ERROR if succeeds else an error code.
RegError RegistryKey::getValue ( const ::rtl::OUString keyName,
RegValue  pValue 
)
inline

gets the value of a key.

Parameters
keyNamespecifies the name of the key which value will be returned. If keyName is an empty string, the value is get from the key specified by hKey.
pValuepoints to an allocated memory block receiving the data of the value.
Returns
REG_NO_ERROR if succeeds else an error code.
RegError RegistryKey::getValueInfo ( const ::rtl::OUString keyName,
RegValueType pValueType,
sal_uInt32 *  pValueSize 
)
inline

gets info about type and size of a value.

Parameters
keyNamespecifies the name of the key which value info will be returned. If keyName is an empty string, the value info of the key specified by hKey will be returned.
pValueTypereturns the type of the value.
pValueSizereturns the size of the value in bytes or the length of a list value.
Returns
REG_NO_ERROR if succeeds else an error code.
sal_Bool RegistryKey::isReadOnly ( ) const
inline

returns the access mode of the key.

Returns
TRUE if access mode is read only else FALSE.
sal_Bool RegistryKey::isValid ( void  ) const
inline

checks if the key points to a valid registry key.

RegError RegistryKey::openKey ( const ::rtl::OUString keyName,
RegistryKey rOpenKey 
)
inline

opens the specified key.

The specified keyname is relativ to this key.

Parameters
keyNamespecifies the name of the key which will be opened.
rOpenKeyreferences a RegistryKey which will be filled with the open key.
Returns
REG_NO_ERROR if succeeds else an error code.
RegError RegistryKey::openSubKeys ( const ::rtl::OUString keyName,
RegistryKeyArray rSubKeys 
)
inline

opens all subkeys of the specified key.

The specified keyname is relativ to this key.

Parameters
keyNamespecifies the name of the key which subkeys will be opened.
rSubKeysreference a RegistryKeyArray which will be filled with the open subkeys.
Returns
REG_NO_ERROR if succeeds else an error code.
RegistryKey & RegistryKey::operator= ( const RegistryKey toAssign)
inline

Assign operator.

void RegistryKey::releaseKey ( )
inline

releases the current key

RegError RegistryKey::setLongListValue ( const ::rtl::OUString keyName,
sal_Int32 *  pValueList,
sal_uInt32  len 
)
inline

sets a long list value of a key.

Parameters
keyNamespecifies the name of the key which value will be set. If keyName is an empty string, the value will be set for the key specified by hKey.
pValueListpoints to an array of longs containing the data for the value.
lenspecifies the length of the list (the array referenced by pValueList).
Returns
REG_NO_ERROR if succeeds else an error code.
RegError RegistryKey::setStringListValue ( const ::rtl::OUString keyName,
sal_Char **  pValueList,
sal_uInt32  len 
)
inline

sets an ascii list value of a key.

Parameters
keyNamespecifies the name of the key which value will be set. If keyName is an empty string, the value will be set for the key specified by hKey.
pValueListpoints to an array of sal_Char* containing the data for the value.
lenspecifies the length of the list (the array referenced by pValueList).
Returns
REG_NO_ERROR if succeeds else an error code.
RegError RegistryKey::setUnicodeListValue ( const ::rtl::OUString keyName,
sal_Unicode **  pValueList,
sal_uInt32  len 
)
inline

sets an unicode string list value of a key.

Parameters
keyNamespecifies the name of the key which value will be set. If keyName is an empty string, the value will be set for the key specified by hKey.
pValueListpoints to an array of sal_Unicode* containing the data for the value.
lenspecifies the length of the list (the array referenced by pValueList).
Returns
REG_NO_ERROR if succeeds else an error code.
RegError RegistryKey::setValue ( const ::rtl::OUString keyName,
RegValueType  valueType,
RegValue  pValue,
sal_uInt32  valueSize 
)
inline

sets a value of a key.

Parameters
keyNamespecifies the name of the key which value will be set. If keyName is an empty string, the value will be set for the key specified by hKey.
valueTypespecifies the type of the value.
pValuepoints to a memory block containing the data for the value.
valueSizespecifies the size of pData in bytes
Returns
REG_NO_ERROR if succeeds else an error code.

Friends And Related Function Documentation

friend class Registry
friend

Member Data Documentation

RegKeyHandle RegistryKey::m_hImpl

stores the current key handle of this key

Registry RegistryKey::m_registry

stores the registry on which this key works


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