24#include <rtl/ustring.hxx>
92 { other.m_hImpl =
nullptr; }
105 other.m_hImpl =
nullptr;
238 inline void setKeyNames(
Registry const & registry, rtl_uString** pKeyNames, sal_uInt32 length);
253template<
class ValueType>
302 ValueType* pValueList, sal_uInt32 length)
417 sal_uInt32 valueSize);
429 sal_Int32
const * pValueList,
469 sal_uInt32* pValueSize);
523 OUString& rResolvedName)
const;
542 inline void setRegistry(
Registry const & registry);
589 , m_pKeyNames(nullptr)
614 rtl_uString** pKeyNames,
628 : m_registry(registry)
637 : m_registry(toCopy.m_registry)
645inline void RegistryKey::setRegistry(
Registry const & registry)
671 {
return (
m_hImpl !=
nullptr); }
725 &pSubKeys, &nSubKeys);
744 rtl_uString** pSubKeyNames;
747 &pSubKeyNames, &nSubKeys);
786 sal_uInt32 valueSize)
796 sal_Int32
const * pValueList,
830 sal_uInt32* pValueSize)
853 sal_Int32* pValueList;
917 OUString& rResolvedName)
const
923 &rResolvedName.pData);
972 {
return (
m_hImpl !=
nullptr ); }
979 rRootKey.setRegistry(*
this);
1002 return m_pApi->openRegistry(registryName.pData, &
m_hImpl, accessMode);
RegistryKeyArray represents an array of open keys.
~RegistryKeyArray()
Destructor, all subkeys will be closed.
RegKeyHandle * m_phKeys
stores an array of open subkeys.
sal_uInt32 getLength() const
returns the length of the array.
void setKeyHandles(Registry const ®istry, RegKeyHandle *phKeys, sal_uInt32 length)
sets the data of the key array.
sal_uInt32 m_length
stores the number of open subkeys, the number of elements.
Registry m_registry
stores the handle to the registry file where the appropriate keys are located.
RegistryKeyArray()
Default constructor.
RegistryKey getElement(sal_uInt32 index)
returns the open key specified by index.
RegistryKeyNames represents an array of key names.
OUString getElement(sal_uInt32 index)
returns the name of the key specified by index.
rtl_uString ** m_pKeyNames
stores an array of key names.
~RegistryKeyNames()
Destructor, the internal array with key names will be deleted.
RegistryKeyNames()
Default constructor.
Registry m_registry
stores the handle to the registry file where the appropriate keys are located.
void setKeyNames(Registry const ®istry, rtl_uString **pKeyNames, sal_uInt32 length)
sets the data of the array.
sal_uInt32 m_length
stores the number of key names, the number of elements.
sal_uInt32 getLength() const
returns the length of the array.
RegistryKey reads or writes information of the underlying key in a registry.
OUString getRegistryName()
returns the name of the registry in which the key is defined.
RegError getKeyNames(const OUString &keyName, RegistryKeyNames &rSubKeyNames)
returns an array with the names of all subkeys of the specified key.
RegError openKey(const OUString &keyName, RegistryKey &rOpenKey)
opens the specified key.
RegistryKey & operator=(const RegistryKey &toAssign)
Assign operator.
RegError deleteKey(const OUString &keyName)
deletes the specified key.
RegError getResolvedKeyName(const OUString &keyName, OUString &rResolvedName) const
resolves a keyname.
RegError closeKey()
closes explicitly the current key
RegError getLongListValue(const OUString &keyName, RegistryValueList< sal_Int32 > &rValueList)
gets a long list value of a key.
RegistryKey()
Default constructor.
~RegistryKey()
Destructor, close the key if it references an open one.
OUString getName()
returns the full qualified name of the key beginning with the rootkey.
RegError getValueInfo(const OUString &keyName, RegValueType *pValueType, sal_uInt32 *pValueSize)
gets info about type and size of a value.
bool isValid() const
checks if the key points to a valid registry key.
RegError getUnicodeListValue(const OUString &keyName, RegistryValueList< sal_Unicode * > &rValueList)
gets a unicode value of a key.
RegError setValue(const OUString &keyName, RegValueType valueType, RegValue pValue, sal_uInt32 valueSize)
sets a value of a key.
RegError setStringListValue(const OUString &keyName, char **pValueList, sal_uInt32 len)
sets an ascii list value of a key.
RegError getValue(const OUString &keyName, RegValue pValue)
gets the value of a key.
bool isReadOnly() const
returns the access mode of the key.
RegError openSubKeys(const OUString &keyName, RegistryKeyArray &rSubKeys)
opens all subkeys of the specified key.
RegError setLongListValue(const OUString &keyName, sal_Int32 const *pValueList, sal_uInt32 len)
sets a long list value of a key.
Registry m_registry
stores the registry on which this key works
RegError setUnicodeListValue(const OUString &keyName, sal_Unicode **pValueList, sal_uInt32 len)
sets a unicode string list value of a key.
RegKeyHandle m_hImpl
stores the current key handle of this key
RegError createKey(const OUString &keyName, RegistryKey &rNewKey)
creates a new key or opens a key if the specified key already exists.
RegError getStringListValue(const OUString &keyName, RegistryValueList< char * > &rValueList)
gets an ascii list value of a key.
RegistryValueList represents a value list of the specified type.
sal_uInt32 m_length
stores the length of the list, the number of elements.
RegistryValueList()
Default constructor.
void setValueList(const Registry ®istry, RegValueType valueType, ValueType *pValueList, sal_uInt32 length)
sets the data of the value list.
ValueType * m_pValueList
stores the value list.
ValueType getElement(sal_uInt32 index)
returns the value of the list specified by index.
RegValueType m_valueType
stores the type of the list elements
sal_uInt32 getLength()
returns the length of the list.
~RegistryValueList()
Destructor, the internal value list will be freed.
Registry m_registry
stores the handle to the registry file where the appropriate key to this value is located.
The Registry provides the functionality to read and write information in a registry file.
RegError create(const OUString ®istryName)
creates a new registry with the specified name and creates a root key.
RegError close()
closes explicitly the current registry data file.
Registry & operator=(const Registry &toAssign)
Assign operator.
Registry(Registry &&other) noexcept
RegError openRootKey(RegistryKey &rRootKey)
opens the root key of the registry.
OUString getName()
returns the name of the current registry data file.
RegHandle m_hImpl
stores the handle of the underlying registry file on which most of the functions work.
RegError open(const OUString ®istryName, RegAccessMode accessMode)
opens a registry with the specified name.
~Registry()
Destructor. The Destructor close the registry if it is open.
Registry()
Default constructor.
RegError destroy(const OUString ®istryName)
destroys a registry.
bool isValid() const
checks if the registry points to a valid registry data file.
bool isReadOnly() const
returns the access mode of the registry.
const Registry_Api * m_pApi
stores the used and initialized registry Api.
const Registry_Api * getApi() const
returns the used registry Api.
static RegError REGISTRY_CALLTYPE closeRegistry(RegHandle hReg)
static RegError REGISTRY_CALLTYPE createRegistry(rtl_uString *registryName, RegHandle *phRegistry)
static sal_Bool REGISTRY_CALLTYPE isReadOnly(RegHandle hReg)
static RegError REGISTRY_CALLTYPE openRootKey(RegHandle hReg, RegKeyHandle *phRootKey)
static RegError REGISTRY_CALLTYPE openRegistry(rtl_uString *registryName, RegHandle *phRegistry, RegAccessMode accessMode)
static void REGISTRY_CALLTYPE acquire(RegHandle hReg)
static void REGISTRY_CALLTYPE release(RegHandle hReg)
static RegError REGISTRY_CALLTYPE getName(RegHandle hReg, rtl_uString **pName)
static RegError REGISTRY_CALLTYPE destroyRegistry(RegHandle hReg, rtl_uString *registryName)
REG_DLLPUBLIC Registry_Api *REGISTRY_CALLTYPE initRegistry_Api()
the API initialization function.
RegError REGISTRY_CALLTYPE setUnicodeListValue(RegKeyHandle hKey, rtl_uString *keyName, sal_Unicode **pValueList, sal_uInt32 len)
RegError REGISTRY_CALLTYPE setLongListValue(RegKeyHandle hKey, rtl_uString *keyName, sal_Int32 const *pValueList, sal_uInt32 len)
RegError REGISTRY_CALLTYPE createKey(RegKeyHandle hKey, rtl_uString *keyName, RegKeyHandle *phNewKey)
RegError REGISTRY_CALLTYPE setStringListValue(RegKeyHandle hKey, rtl_uString *keyName, char **pValueList, sal_uInt32 len)
void REGISTRY_CALLTYPE acquireKey(RegKeyHandle hKey)
RegError REGISTRY_CALLTYPE getValueInfo(RegKeyHandle hKey, rtl_uString *keyName, RegValueType *pValueType, sal_uInt32 *pValueSize)
RegError REGISTRY_CALLTYPE getStringListValue(RegKeyHandle hKey, rtl_uString *keyName, char ***pValueList, sal_uInt32 *pLen)
void REGISTRY_CALLTYPE releaseKey(RegKeyHandle hKey)
RegError REGISTRY_CALLTYPE getKeyNames(RegKeyHandle hKey, rtl_uString *keyName, rtl_uString ***pSubKeyNames, sal_uInt32 *pnSubKeys)
RegError REGISTRY_CALLTYPE getLongListValue(RegKeyHandle hKey, rtl_uString *keyName, sal_Int32 **pValueList, sal_uInt32 *pLen)
RegError REGISTRY_CALLTYPE getKeyName(RegKeyHandle hKey, rtl_uString **pKeyName)
RegError REGISTRY_CALLTYPE deleteKey(RegKeyHandle hKey, rtl_uString *keyName)
RegError REGISTRY_CALLTYPE getResolvedKeyName(RegKeyHandle hKey, rtl_uString *keyName, SAL_UNUSED_PARAMETER sal_Bool, rtl_uString **pResolvedName)
RegError REGISTRY_CALLTYPE closeSubKeys(RegKeyHandle *phSubKeys, sal_uInt32 nSubKeys)
RegError REGISTRY_CALLTYPE freeKeyNames(rtl_uString **pKeyNames, sal_uInt32 nKeys)
RegError REGISTRY_CALLTYPE freeValueList(RegValueType valueType, RegValue pValueList, sal_uInt32 len)
sal_Bool REGISTRY_CALLTYPE isKeyReadOnly(RegKeyHandle hKey)
RegError REGISTRY_CALLTYPE openKey(RegKeyHandle hKey, rtl_uString *keyName, RegKeyHandle *phOpenKey)
RegError REGISTRY_CALLTYPE openSubKeys(RegKeyHandle hKey, rtl_uString *keyName, RegKeyHandle **pphSubKeys, sal_uInt32 *pnSubKeys)
RegError REGISTRY_CALLTYPE closeKey(RegKeyHandle hKey)
RegError REGISTRY_CALLTYPE getValue(RegKeyHandle hKey, rtl_uString *keyName, RegValue pValue)
RegError REGISTRY_CALLTYPE getUnicodeListValue(RegKeyHandle hKey, rtl_uString *keyName, sal_Unicode ***pValueList, sal_uInt32 *pLen)
RegError REGISTRY_CALLTYPE setValue(RegKeyHandle hKey, rtl_uString *keyName, RegValueType valueType, RegValue pData, sal_uInt32 valueSize)
STRINGLIST
The key has a value of type ascii string list.
void * RegHandle
defines the type of a registry handle used in the C API.
void * RegKeyHandle
defines the type of a registry key handle used in the C API.
INVALID_KEY
the key is not in a valid state.
RegAccessMode
defines the open/access mode of the registry.
NOT_DEFINED
The key has no value or the value type is unknown.
enum SAL_DLLPUBLIC_RTTI RegValueType
defines the type of a key value.
void * RegValue
defines the type of a registry key value handle used in the C API.
#define REGISTRY_CALLTYPE
specify the calling convention for the registry API
LONGLIST
The key has a value of type long list.
enum SAL_DLLPUBLIC_RTTI RegError
specifies the possible error codes which can occur using the registry API.
specifies a collection of function pointers which represents the complete registry C-API.
void(REGISTRY_CALLTYPE *releaseKey)(RegKeyHandle)
rtl_uString rtl_uString RegKeyHandle rtl_uString RegKeyHandle * RegError(REGISTRY_CALLTYPE *openSubKeys)(RegKeyHandle
rtl_uString sal_Int32 sal_uInt32 * RegError(REGISTRY_CALLTYPE *getStringListValue)(RegKeyHandle
RegKeyHandle * RegError(REGISTRY_CALLTYPE *getName)(RegHandle
RegError(REGISTRY_CALLTYPE *setValue)(RegKeyHandle
rtl_uString * RegError(REGISTRY_CALLTYPE *closeKey)(RegKeyHandle)
RegError(REGISTRY_CALLTYPE *closeRegistry)(RegHandle)
rtl_uString RegValueType sal_uInt32 * RegError(REGISTRY_CALLTYPE *getValue)(RegKeyHandle
RegError(REGISTRY_CALLTYPE *deleteKey)(RegKeyHandle
RegError(REGISTRY_CALLTYPE *getKeyName)(RegKeyHandle
rtl_uString sal_Int32 sal_uInt32 rtl_uString char sal_uInt32 * RegError(REGISTRY_CALLTYPE *getUnicodeListValue)(RegKeyHandle
RegKeyHandle rtl_uString ** RegError(REGISTRY_CALLTYPE *createRegistry)(rtl_uString *
sal_Bool(REGISTRY_CALLTYPE *isReadOnly)(RegHandle)
RegError(REGISTRY_CALLTYPE *getLongListValue)(RegKeyHandle
RegError(REGISTRY_CALLTYPE *destroyRegistry)(RegHandle
sal_Bool(REGISTRY_CALLTYPE *isKeyReadOnly)(RegKeyHandle)
rtl_uString ** RegError(REGISTRY_CALLTYPE *createKey)(RegKeyHandle
rtl_uString sal_Int32 sal_uInt32 rtl_uString char sal_uInt32 rtl_uString sal_Unicode sal_uInt32 * RegError(REGISTRY_CALLTYPE *freeValueList)(RegValueType
RegKeyHandle rtl_uString RegHandle RegHandle RegAccessMode
rtl_uString rtl_uString RegKeyHandle rtl_uString RegKeyHandle rtl_uString RegKeyHandle sal_uInt32 sal_uInt32
rtl_uString rtl_uString RegKeyHandle rtl_uString RegKeyHandle rtl_uString RegKeyHandle sal_uInt32 * RegError(REGISTRY_CALLTYPE *closeSubKeys)(RegKeyHandle *
rtl_uString rtl_uString RegKeyHandle * RegError(REGISTRY_CALLTYPE *openKey)(RegKeyHandle
rtl_uString * void(REGISTRY_CALLTYPE *acquireKey)(RegKeyHandle)
void(REGISTRY_CALLTYPE *release)(RegHandle)
RegError(REGISTRY_CALLTYPE *setLongListValue)(RegKeyHandle
RegError(REGISTRY_CALLTYPE *getResolvedKeyName)(RegKeyHandle
RegError(REGISTRY_CALLTYPE *setUnicodeListValue)(RegKeyHandle
rtl_uString rtl_uString rtl_uString rtl_uString sal_uInt32 * RegError(REGISTRY_CALLTYPE *freeKeyNames)(rtl_uString **
void(REGISTRY_CALLTYPE *acquire)(RegHandle)
RegError(REGISTRY_CALLTYPE *getValueInfo)(RegKeyHandle
rtl_uString rtl_uString ** RegError(REGISTRY_CALLTYPE *getKeyNames)(RegKeyHandle
RegError(REGISTRY_CALLTYPE *setStringListValue)(RegKeyHandle
RegError(REGISTRY_CALLTYPE *openRootKey)(RegHandle