UDK 3.2.7 C/C++ API Reference
Public Member Functions | Protected Attributes | Friends
Registry Class Reference

The Registry provides the functionality to read and write information in a registry file. More...

#include <registry.hxx>

List of all members.

Public Member Functions

 Registry ()
 Default constructor.
 Registry (const Registry &toCopy)
 Copy constructcor.
 ~Registry ()
 Destructor. The Destructor close the registry if it is open.
Registryoperator= (const Registry &toAssign)
 Assign operator.
sal_Bool isValid () const
 checks if the registry points to a valid registry data file.
sal_Bool isReadOnly () const
 returns the access mode of the registry.
RegError openRootKey (RegistryKey &rRootKey)
 opens the root key of the registry.
inline::rtl::OUString getName ()
 returns the name of the current registry data file.
RegError create (const ::rtl::OUString &registryName)
 creates a new registry with the specified name and creates a root key.
RegError open (const ::rtl::OUString &registryName, RegAccessMode accessMode)
 opens a registry with the specified name.
RegError close ()
 closes explicitly the current registry data file.
RegError destroy (const ::rtl::OUString &registryName)
 destroys a registry.
RegError loadKey (RegistryKey &rKey, const ::rtl::OUString &keyName, const ::rtl::OUString &regFileName)
 loads registry information from a specified file and save it under the specified keyName.
RegError saveKey (RegistryKey &rKey, const ::rtl::OUString &keyName, const ::rtl::OUString &regFileName)
 saves the registry information of the specified key and all subkeys and save it in the specified file.
RegError mergeKey (RegistryKey &rKey, const ::rtl::OUString &keyName, const ::rtl::OUString &regFileName, sal_Bool bWarnings=sal_False, sal_Bool bReport=sal_False)
 merges the registry information of the specified key with the registry information of the specified file.
RegError dumpRegistry (RegistryKey &rKey)
 This function reports the complete registry information of a key and all of its subkeys.
const Registry_ApigetApi ()
 returns the used registry Api.

Protected Attributes

const Registry_Apim_pApi
 stores the used and initialized registry Api.
RegHandle m_hImpl
 stores the handle of the underlying registry file on which most of the functions work.

Friends

class RegistryKey
class RegistryKeyArray
class RegistryKeyNames

Detailed Description

The Registry provides the functionality to read and write information in a registry file.

The class is implemented inline and use a C-Api.


Constructor & Destructor Documentation

Registry::Registry ( ) [inline]

Default constructor.

Registry::Registry ( const Registry toCopy) [inline]

Copy constructcor.

Registry::~Registry ( ) [inline]

Destructor. The Destructor close the registry if it is open.


Member Function Documentation

RegError Registry::close ( void  ) [inline]

closes explicitly the current registry data file.

RegError Registry::create ( const ::rtl::OUString registryName) [inline]

creates a new registry with the specified name and creates a root key.

Parameters:
registryNamespecifies the name of the new registry.
Returns:
REG_NO_ERROR if succeeds else an error code.
RegError Registry::destroy ( const ::rtl::OUString registryName) [inline]

destroys a registry.

Parameters:
registryNamespecifies a registry name, if the name is an empty string the registry itselfs will be destroyed.
Returns:
REG_NO_ERROR if succeeds else an error code.
RegError Registry::dumpRegistry ( RegistryKey rKey) [inline]

This function reports the complete registry information of a key and all of its subkeys.

All information which are available (keynames, value types, values, ...) will be printed to stdout for report issues only.

Parameters:
rKeyreferences a currently open key which content will be reported.
Returns:
REG_NO_ERROR if succeeds else an error code.
const Registry_Api* Registry::getApi ( ) [inline]

returns the used registry Api.

rtl::OUString Registry::getName ( ) [inline]

returns the name of the current registry data file.

sal_Bool Registry::isReadOnly ( ) const [inline]

returns the access mode of the registry.

Returns:
TRUE if the access mode is readonly else FALSE.
sal_Bool Registry::isValid ( void  ) const [inline]

checks if the registry points to a valid registry data file.

RegError Registry::loadKey ( RegistryKey rKey,
const ::rtl::OUString keyName,
const ::rtl::OUString regFileName 
) [inline]

loads registry information from a specified file and save it under the specified keyName.

Parameters:
rKeyreferences a currently open key. The key which should store the registry information is a subkey of this key.
keyNamespecifies the name of the key which stores the registry information. If keyName is is an empty string the registry information will be saved under the key specified by rKey.
regFileNamespecifies the file containing the registry information.
Returns:
REG_NO_ERROR if succeeds else an error code.
RegError Registry::mergeKey ( RegistryKey rKey,
const ::rtl::OUString keyName,
const ::rtl::OUString regFileName,
sal_Bool  bWarnings = sal_False,
sal_Bool  bReport = sal_False 
) [inline]

merges the registry information of the specified key with the registry information of the specified file.

All existing keys will be extended and existing key values will be overwritten.

Parameters:
rKeyreferences a currently open key. The key which information is merged by this function is a subkey of this key
keyNamespecifies the name of the key which will be merged. If keyName is an empty string the registry information under the key specified by rKey is merged with the information from the specified file.
regFileNamespecifies the file containing the registry information.
bWarningsif TRUE the function returns an error if a key already exists.
bReportif TRUE the function reports warnings on stdout if a key already exists.
Returns:
REG_NO_ERROR if succeeds else an error code. If it returns an error the registry will restore the state before merging.
RegError Registry::open ( const ::rtl::OUString registryName,
RegAccessMode  accessMode 
) [inline]

opens a registry with the specified name.

If the registry already points to a valid registry, the old registry will be closed.

Parameters:
registryNamespecifies a registry name.
accessModespecifies the access mode for the registry, REG_READONLY or REG_READWRITE.
Returns:
REG_NO_ERROR if succeeds else an error code.
RegError Registry::openRootKey ( RegistryKey rRootKey) [inline]

opens the root key of the registry.

Parameters:
rRootKeyreference to a RegistryKey which is filled with the rootkey.
Returns:
REG_NO_ERROR if succeeds else an error code.
Registry & Registry::operator= ( const Registry toAssign) [inline]

Assign operator.

RegError Registry::saveKey ( RegistryKey rKey,
const ::rtl::OUString keyName,
const ::rtl::OUString regFileName 
) [inline]

saves the registry information of the specified key and all subkeys and save it in the specified file.

Parameters:
rKeyreferences a currently open key. The key which information is saved by this function is a subkey of this key.
keyNamespecifies the name of the key which information should be stored. If keyName is an empty string the registry information under the key specified by rKey is saved in the specified file.
regFileNamespecifies the file containing the registry information.
Returns:
REG_NO_ERROR if succeeds else an error code.

Friends And Related Function Documentation

friend class RegistryKey [friend]
friend class RegistryKeyArray [friend]
friend class RegistryKeyNames [friend]

Member Data Documentation

stores the handle of the underlying registry file on which most of the functions work.

const Registry_Api* Registry::m_pApi [protected]

stores the used and initialized registry Api.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines