LibreOffice Module registry (master)  1
Public Member Functions | Private Attributes | Friends | List of all members
Registry Class Referencefinal

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

#include <registry.hxx>

Collaboration diagram for Registry:
[legend]

Public Member Functions

 Registry ()
 Default constructor. More...
 
 Registry (const Registry &toCopy)
 Copy constructor. More...
 
 Registry (Registry &&other) noexcept
 
 ~Registry ()
 Destructor. The Destructor close the registry if it is open. More...
 
Registryoperator= (const Registry &toAssign)
 Assign operator. More...
 
Registryoperator= (Registry &&other)
 
bool isValid () const
 checks if the registry points to a valid registry data file. More...
 
bool isReadOnly () const
 returns the access mode of the registry. More...
 
RegError openRootKey (RegistryKey &rRootKey)
 opens the root key of the registry. More...
 
OUString getName ()
 returns the name of the current registry data file. More...
 
RegError create (const OUString &registryName)
 creates a new registry with the specified name and creates a root key. More...
 
RegError open (const OUString &registryName, RegAccessMode accessMode)
 opens a registry with the specified name. More...
 
RegError close ()
 closes explicitly the current registry data file. More...
 
RegError destroy (const OUString &registryName)
 destroys a registry. More...
 
RegError mergeKey (RegistryKey &rKey, const OUString &keyName, const OUString &regFileName, bool bReport)
 merges the registry information of the specified key with the registry information of the specified file. More...
 
const Registry_ApigetApi () const
 returns the used registry Api. More...
 

Private Attributes

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

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.

Definition at line 82 of file registry.hxx.

Constructor & Destructor Documentation

Registry::Registry ( )
inline

Default constructor.

Definition at line 968 of file registry.hxx.

Registry::Registry ( const Registry toCopy)
inline

Copy constructor.

Definition at line 973 of file registry.hxx.

References m_hImpl, and m_pApi.

Registry::Registry ( Registry &&  other)
inlinenoexcept

Definition at line 92 of file registry.hxx.

Registry::~Registry ( )
inline

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

Definition at line 982 of file registry.hxx.

References m_hImpl, and m_pApi.

Member Function Documentation

RegError Registry::close ( )
inline

closes explicitly the current registry data file.

Definition at line 1035 of file registry.hxx.

References m_hImpl, m_pApi, NO_ERROR, and RegError.

RegError Registry::create ( const 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
RegError::NO_ERROR if succeeds else an error code.

Definition at line 1020 of file registry.hxx.

References m_hImpl, and m_pApi.

RegError Registry::destroy ( const OUString &  registryName)
inline

destroys a registry.

Parameters
registryNamespecifies a registry name, if the name is an empty string the registry itself will be destroyed.
Returns
RegError::NO_ERROR if succeeds else an error code.

Definition at line 1043 of file registry.hxx.

References m_hImpl, m_pApi, NO_ERROR, and RegError.

const Registry_Api* Registry::getApi ( ) const
inline

returns the used registry Api.

Definition at line 181 of file registry.hxx.

References m_pApi.

Referenced by RegistryValueList< ValueType >::~RegistryValueList().

OUString Registry::getName ( )
inline

returns the name of the current registry data file.

Definition at line 1013 of file registry.hxx.

References m_hImpl, and m_pApi.

Referenced by RegistryKey::getRegistryName().

bool Registry::isReadOnly ( ) const
inline

returns the access mode of the registry.

Returns
TRUE if the access mode is readonly else FALSE.

Definition at line 1004 of file registry.hxx.

References m_hImpl, and m_pApi.

bool Registry::isValid ( ) const
inline
RegError Registry::mergeKey ( RegistryKey rKey,
const OUString &  keyName,
const OUString &  regFileName,
bool  bReport 
)
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.
bReportif TRUE the function reports warnings on stdout if a key already exists.
Returns
RegError::NO_ERROR if succeeds else an error code. If it returns an error the registry will restore the state before merging.

Definition at line 1051 of file registry.hxx.

References m_hImpl, RegistryKey::m_hImpl, and m_pApi.

RegError Registry::open ( const 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, RegAccessMode::READONLY or RegAccessMode::READWRITE.
Returns
RegError::NO_ERROR if succeeds else an error code.

Definition at line 1027 of file registry.hxx.

References m_hImpl, and m_pApi.

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
RegError::NO_ERROR if succeeds else an error code.

Definition at line 1007 of file registry.hxx.

References m_hImpl, RegistryKey::m_hImpl, and m_pApi.

Registry & Registry::operator= ( const Registry toAssign)
inline

Assign operator.

Definition at line 988 of file registry.hxx.

References m_hImpl, and m_pApi.

Registry& Registry::operator= ( Registry &&  other)
inline

Definition at line 101 of file registry.hxx.

References m_hImpl, and m_pApi.

Friends And Related Function Documentation

friend class RegistryKey
friend

Definition at line 176 of file registry.hxx.

friend class RegistryKeyArray
friend

Definition at line 177 of file registry.hxx.

friend class RegistryKeyNames
friend

Definition at line 178 of file registry.hxx.

Member Data Documentation

RegHandle Registry::m_hImpl
private

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

Definition at line 187 of file registry.hxx.

Referenced by close(), create(), destroy(), getName(), isReadOnly(), isValid(), mergeKey(), open(), openRootKey(), operator=(), Registry(), and ~Registry().

const Registry_Api* Registry::m_pApi
private

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