24 #include <rtl/ustring.hxx>
93 { other.m_hImpl =
nullptr; }
106 other.m_hImpl =
nullptr;
172 const OUString& keyName,
173 const OUString& regFileName,
256 inline void setKeyNames(
Registry const & registry, rtl_uString** pKeyNames, sal_uInt32 length);
271 template<
class ValueType>
320 ValueType* pValueList, sal_uInt32 length)
438 sal_uInt32 valueSize);
450 sal_Int32
const * pValueList,
490 sal_uInt32* pValueSize);
544 OUString& rResolvedName)
const;
563 inline void setRegistry(
Registry const & registry);
610 , m_pKeyNames(nullptr)
635 rtl_uString** pKeyNames,
649 : m_registry(registry)
658 : m_registry(toCopy.m_registry)
666 inline void RegistryKey::setRegistry(
Registry const & registry)
692 {
return (
m_hImpl !=
nullptr); }
746 &pSubKeys, &nSubKeys);
765 rtl_uString** pSubKeyNames;
768 &pSubKeyNames, &nSubKeys);
816 sal_uInt32 valueSize)
826 sal_Int32
const * pValueList,
860 sal_uInt32* pValueSize)
883 sal_Int32* pValueList;
886 &pValueList, &length);
909 &pValueList, &length);
932 &pValueList, &length);
947 OUString& rResolvedName)
const
953 &rResolvedName.pData);
1002 {
return (
m_hImpl !=
nullptr ); }
1009 rRootKey.setRegistry(*
this);
1024 return m_pApi->createRegistry(registryName.pData, &
m_hImpl);
1032 return m_pApi->openRegistry(registryName.pData, &
m_hImpl, accessMode);
1052 const OUString& keyName,
1053 const OUString& regFileName,
1055 {
return m_pApi->mergeKey(
m_hImpl, rKey.
m_hImpl, keyName.pData, regFileName.pData,
false, bReport); }
RegError REGISTRY_CALLTYPE setValue(RegKeyHandle hKey, rtl_uString *keyName, RegValueType valueType, RegValue pData, sal_uInt32 valueSize)
sal_uInt32 m_length
stores the number of open subkeys, the number of elements.
static RegError REGISTRY_CALLTYPE openRootKey(RegHandle hReg, RegKeyHandle *phRootKey)
STRINGLIST
The key has a value of type ascii string list.
void setKeyNames(Registry const ®istry, rtl_uString **pKeyNames, sal_uInt32 length)
sets the data of the array.
RegError destroy(const OUString ®istryName)
destroys a registry.
rtl_uString sal_Unicode sal_uInt32
bool isValid() const
checks if the key points to a valid registry key.
RegistryKey & operator=(const RegistryKey &toAssign)
Assign operator.
RegError mergeKey(RegistryKey &rKey, const OUString &keyName, const OUString ®FileName, bool bReport)
merges the registry information of the specified key with the registry information of the specified f...
RegError REGISTRY_CALLTYPE getStringListValue(RegKeyHandle hKey, rtl_uString *keyName, char ***pValueList, sal_uInt32 *pLen)
RegError openKey(const OUString &keyName, RegistryKey &rOpenKey)
opens the specified key.
RegAccessMode
defines the open/access mode of the registry.
sal_uInt32 getLength() const
returns the length of the array.
sal_Bool REGISTRY_CALLTYPE isKeyReadOnly(RegKeyHandle hKey)
const Registry_Api * m_pApi
stores the used and initialized registry Api.
RegError getValueInfo(const OUString &keyName, RegValueType *pValueType, sal_uInt32 *pValueSize)
gets info about type and size of a value.
rtl_uString char sal_uInt32
RegError setStringListValue(const OUString &keyName, char **pValueList, sal_uInt32 len)
sets an ascii list value of a key.
sal_uInt32 m_length
stores the number of key names, the number of elements.
LONGLIST
The key has a value of type long list.
const Registry_Api * getApi() const
returns the used registry Api.
RegError REGISTRY_CALLTYPE closeKey(RegKeyHandle hKey)
RegistryKey getElement(sal_uInt32 index)
returns the open key specified by index.
OUString getElement(sal_uInt32 index)
returns the name of the key specified by index.
static RegError REGISTRY_CALLTYPE openRegistry(rtl_uString *registryName, RegHandle *phRegistry, RegAccessMode accessMode)
RegError getValue(const OUString &keyName, RegValue pValue)
gets the value of a key.
RegError REGISTRY_CALLTYPE getUnicodeListValue(RegKeyHandle hKey, rtl_uString *keyName, sal_Unicode ***pValueList, sal_uInt32 *pLen)
static void REGISTRY_CALLTYPE acquire(RegHandle hReg)
RegKeyHandle rtl_uString RegHandle RegHandle RegAccessMode
rtl_uString rtl_uString rtl_uString sal_Bool
static void TYPEREG_CALLTYPE release(TypeWriterImpl hEntry)
RegError close()
closes explicitly the current registry data file.
NOT_DEFINED
The key has no value or the value type is unknown.
Registry m_registry
stores the registry on which this key works
specifies a collection of function pointers which represents the complete registry C-API...
RegError REGISTRY_CALLTYPE getValue(RegKeyHandle hKey, rtl_uString *keyName, RegValue pValue)
Registry m_registry
stores the handle to the registry file where the appropriate keys are located.
Registry m_registry
stores the handle to the registry file where the appropriate keys are located.
RegKeyHandle m_hImpl
stores the current key handle of this key
RegError REGISTRY_CALLTYPE getResolvedKeyName(RegKeyHandle hKey, rtl_uString *keyName, SAL_UNUSED_PARAMETER sal_Bool, rtl_uString **pResolvedName)
RegError getKeyNames(const OUString &keyName, RegistryKeyNames &rSubKeyNames)
returns an array with the names of all subkeys of the specified key.
rtl_uString ** m_pKeyNames
stores an array of key names.
Registry()
Default constructor.
rtl_uString RegValueType sal_uInt32 rtl_uString RegValue
OUString getName()
returns the full qualified name of the key beginning with the rootkey.
static sal_Bool REGISTRY_CALLTYPE isReadOnly(RegHandle hReg)
void * RegHandle
defines the type of a registry handle used in the C API.
sal_uInt32 m_length
stores the length of the list, the number of elements.
Registry & operator=(const Registry &toAssign)
Assign operator.
RegError REGISTRY_CALLTYPE setUnicodeListValue(RegKeyHandle hKey, rtl_uString *keyName, sal_Unicode **pValueList, sal_uInt32 len)
RegistryKeyNames()
Default constructor.
enum SAL_DLLPUBLIC_RTTI RegError
specifies the possible error codes which can occur using the registry API.
RegError setValue(const OUString &keyName, RegValueType valueType, RegValue pValue, sal_uInt32 valueSize)
sets a value of a key.
RegError open(const OUString ®istryName, RegAccessMode accessMode)
opens a registry with the specified name.
RegError REGISTRY_CALLTYPE openKey(RegKeyHandle hKey, rtl_uString *keyName, RegKeyHandle *phOpenKey)
RegistryKey reads or writes information of the underlying key in a registry.
rtl_uString rtl_uString RegKeyHandle rtl_uString RegKeyHandle rtl_uString RegKeyHandle sal_uInt32 sal_uInt32
RegistryValueList represents a value list of the specified type.
RegError openSubKeys(const OUString &keyName, RegistryKeyArray &rSubKeys)
opens all subkeys of the specified key.
enum SAL_DLLPUBLIC_RTTI RegValueType
defines the type of a key value.
RegistryKey()
Default constructor.
OUString getName()
returns the name of the current registry data file.
RegError REGISTRY_CALLTYPE closeSubKeys(RegKeyHandle *phSubKeys, sal_uInt32 nSubKeys)
RegError setLongListValue(const OUString &keyName, sal_Int32 const *pValueList, sal_uInt32 len)
sets a long list value of a key.
RegValueType m_valueType
stores the type of the list elements
static RegError REGISTRY_CALLTYPE destroyRegistry(RegHandle hReg, rtl_uString *registryName)
RegistryKeyNames represents an array of key names.
Registry(Registry &&other) noexcept
~RegistryKey()
Destructor, close the key if it references an open one.
sal_uInt32 getLength() const
returns the length of the array.
Registry m_registry
stores the handle to the registry file where the appropriate key to this value is located...
RegError deleteKey(const OUString &keyName)
deletes the specified key.
void REGISTRY_CALLTYPE acquireKey(RegKeyHandle hKey)
RegError REGISTRY_CALLTYPE setStringListValue(RegKeyHandle hKey, rtl_uString *keyName, char **pValueList, sal_uInt32 len)
RegError getResolvedKeyName(const OUString &keyName, OUString &rResolvedName) const
resolves a keyname.
RegError REGISTRY_CALLTYPE deleteKey(RegKeyHandle hKey, rtl_uString *keyName)
sal_uInt32 getLength()
returns the length of the list.
ValueType * m_pValueList
stores the value list.
RegError REGISTRY_CALLTYPE freeValueList(RegValueType valueType, RegValue pValueList, sal_uInt32 len)
RegError closeKey()
closes explicitly the current key
RegError REGISTRY_CALLTYPE setLongListValue(RegKeyHandle hKey, rtl_uString *keyName, sal_Int32 const *pValueList, sal_uInt32 len)
RegKeyHandle * m_phKeys
stores an array of open subkeys.
~RegistryKeyArray()
Destructor, all subkeys will be closed.
INVALID_KEY
the key is not in a valid state.
static RegError REGISTRY_CALLTYPE closeRegistry(RegHandle hReg)
RegError getUnicodeListValue(const OUString &keyName, RegistryValueList< sal_Unicode * > &rValueList)
gets a unicode value of a key.
void setKeyHandles(Registry const ®istry, RegKeyHandle *phKeys, sal_uInt32 length)
sets the data of the key array.
~Registry()
Destructor. The Destructor close the registry if it is open.
RegError openRootKey(RegistryKey &rRootKey)
opens the root key of the registry.
rtl_uString sal_Int32 sal_uInt32 rtl_uString char sal_uInt32 rtl_uString sal_Unicode sal_uInt32 sal_uInt32
static RegError REGISTRY_CALLTYPE getName(RegHandle hReg, rtl_uString **pName)
void * RegKeyHandle
defines the type of a registry key handle used in the C API.
RegHandle m_hImpl
stores the handle of the underlying registry file on which most of the functions work.
rtl_uString rtl_uString rtl_uString rtl_uString sal_uInt32 sal_uInt32
bool isReadOnly() const
returns the access mode of the key.
void REGISTRY_CALLTYPE releaseKey(RegKeyHandle hKey)
static RegError REGISTRY_CALLTYPE mergeKey(RegHandle hReg, RegKeyHandle hKey, rtl_uString *keyName, rtl_uString *regFileName, sal_Bool bWarnings, sal_Bool bReport)
void * RegValue
defines the type of a registry key value handle used in the C API.
RegError REGISTRY_CALLTYPE openSubKeys(RegKeyHandle hKey, rtl_uString *keyName, RegKeyHandle **pphSubKeys, sal_uInt32 *pnSubKeys)
void setValueList(const Registry ®istry, RegValueType valueType, ValueType *pValueList, sal_uInt32 length)
sets the data of the value list.
RegError REGISTRY_CALLTYPE getLongListValue(RegKeyHandle hKey, rtl_uString *keyName, sal_Int32 **pValueList, sal_uInt32 *pLen)
bool isReadOnly() const
returns the access mode of the registry.
~RegistryKeyNames()
Destructor, the internal array with key names will be deleted.
RegError getStringListValue(const OUString &keyName, RegistryValueList< char * > &rValueList)
gets an ascii list value of a key.
RegError REGISTRY_CALLTYPE getKeyNames(RegKeyHandle hKey, rtl_uString *keyName, rtl_uString ***pSubKeyNames, sal_uInt32 *pnSubKeys)
~RegistryValueList()
Destructor, the internal value list will be freed.
RegError getLongListValue(const OUString &keyName, RegistryValueList< sal_Int32 > &rValueList)
gets a long list value of a key.
bool isValid() const
checks if the registry points to a valid registry data file.
RegError(REGISTRY_CALLTYPE *openRootKey)(RegHandle
RegistryKeyArray represents an array of open keys.
rtl_uString sal_Int32 const sal_uInt32
The Registry provides the functionality to read and write information in a registry file...
static RegError REGISTRY_CALLTYPE createRegistry(rtl_uString *registryName, RegHandle *phRegistry)
ValueType getElement(sal_uInt32 index)
returns the value of the list specified by index.
void(REGISTRY_CALLTYPE *acquire)(RegHandle)
#define REGISTRY_CALLTYPE
specify the calling convention for the registry API
RegError REGISTRY_CALLTYPE getKeyName(RegKeyHandle hKey, rtl_uString **pKeyName)
void releaseKey()
releases the current key
REG_DLLPUBLIC Registry_Api *REGISTRY_CALLTYPE initRegistry_Api()
the API initialization function.
RegistryValueList()
Default constructor.
RegError setUnicodeListValue(const OUString &keyName, sal_Unicode **pValueList, sal_uInt32 len)
sets a unicode string list value of a key.
RegError create(const OUString ®istryName)
creates a new registry with the specified name and creates a root key.
OUString getRegistryName()
returns the name of the registry in which the key is defined.
RegError REGISTRY_CALLTYPE getValueInfo(RegKeyHandle hKey, rtl_uString *keyName, RegValueType *pValueType, sal_uInt32 *pValueSize)
RegError createKey(const OUString &keyName, RegistryKey &rNewKey)
creates a new key or opens a key if the specified key already exists.
RegError REGISTRY_CALLTYPE createKey(RegKeyHandle hKey, rtl_uString *keyName, RegKeyHandle *phNewKey)
RegistryKeyArray()
Default constructor.
RegError REGISTRY_CALLTYPE freeKeyNames(rtl_uString **pKeyNames, sal_uInt32 nKeys)