LibreOffice Module registry (master)  1
keyimpl.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #ifndef INCLUDED_REGISTRY_SOURCE_KEYIMPL_HXX
21 #define INCLUDED_REGISTRY_SOURCE_KEYIMPL_HXX
22 
23 #include <sal/config.h>
24 
25 #include <string_view>
26 
27 #include "regimpl.hxx"
28 #include <rtl/ustring.hxx>
29 
30 class ORegKey
31 {
32 public:
33 
34  ORegKey(const OUString& keyName, ORegistry* pReg);
35  ~ORegKey();
36 
37  void acquire()
38  { ++m_refCount; }
39 
40  sal_uInt32 release()
41  { return --m_refCount; }
42 
44 
45  RegError createKey(const OUString& keyName, RegKeyHandle* phNewKey);
46 
47  RegError openKey(const OUString& keyName, RegKeyHandle* phOpenKey);
48 
49  RegError openSubKeys(const OUString& keyName,
50  RegKeyHandle** phOpenSubKeys,
51  sal_uInt32* pnSubKeys);
52 
53  RegError getKeyNames(const OUString& keyName,
54  rtl_uString*** pSubKeyNames,
55  sal_uInt32* pnSubKeys);
56 
58 
59  RegError deleteKey(const OUString& keyName);
60 
61  RegError getValueInfo(std::u16string_view valueName,
62  RegValueType* pValueTye,
63  sal_uInt32* pValueSize) const;
64 
65  RegError setValue(std::u16string_view valueName,
66  RegValueType vType,
67  RegValue value,
68  sal_uInt32 vSize);
69 
70  RegError setLongListValue(std::u16string_view valueName,
71  sal_Int32 const * pValueList,
72  sal_uInt32 len);
73 
74  RegError setStringListValue(std::u16string_view valueName,
75  char** pValueList,
76  sal_uInt32 len);
77 
78  RegError setUnicodeListValue(std::u16string_view valueName,
79  sal_Unicode** pValueList,
80  sal_uInt32 len);
81 
82  RegError getValue(std::u16string_view valueName, RegValue value) const;
83 
84  RegError getLongListValue(std::u16string_view valueName,
85  sal_Int32** pValueList,
86  sal_uInt32* pLen) const;
87 
88  RegError getStringListValue(std::u16string_view valueName,
89  char*** pValueList,
90  sal_uInt32* pLen) const;
91 
92  RegError getUnicodeListValue(std::u16string_view valueName,
93  sal_Unicode*** pValueList,
94  sal_uInt32* pLen) const;
95 
96  RegError getResolvedKeyName(const OUString& keyName,
97  OUString& resolvedName) const;
98 
99  bool isDeleted() const
100  { return m_bDeleted; }
101 
102  void setDeleted (bool bKeyDeleted)
103  { m_bDeleted = bKeyDeleted; }
104 
105  bool isModified() const
106  { return m_bModified; }
107 
108  void setModified (bool bModified = true)
109  { m_bModified = bModified; }
110 
111  bool isReadOnly() const
112  { return m_pRegistry->isReadOnly(); }
113 
114  sal_uInt32 countSubKeys();
115 
117  { return m_pRegistry; }
118 
120  { return m_pRegistry->getStoreFile(); }
121 
123 
124  const OUString& getName() const
125  { return m_name; }
126 
127  OUString getFullPath(OUString const & path) const;
128 
129 private:
130  sal_uInt32 m_refCount;
131  OUString m_name;
132  bool m_bDeleted:1;
133  bool m_bModified:1;
135 };
136 
137 #endif
138 
139 
140 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const OUString & getName() const
Definition: keyimpl.hxx:124
ORegKey(const OUString &keyName, ORegistry *pReg)
Definition: keyimpl.cxx:40
RegError openSubKeys(const OUString &keyName, RegKeyHandle **phOpenSubKeys, sal_uInt32 *pnSubKeys)
Definition: keyimpl.cxx:84
bool isModified() const
Definition: keyimpl.hxx:105
RegError getResolvedKeyName(const OUString &keyName, OUString &resolvedName) const
Definition: keyimpl.cxx:902
RegError deleteKey(const OUString &keyName)
Definition: keyimpl.cxx:210
RegError releaseKey(RegKeyHandle hKey)
Definition: keyimpl.cxx:60
RegError setUnicodeListValue(std::u16string_view valueName, sal_Unicode **pValueList, sal_uInt32 len)
Definition: keyimpl.cxx:464
bool isDeleted() const
Definition: keyimpl.hxx:99
sal_uInt16 sal_Unicode
RegError getUnicodeListValue(std::u16string_view valueName, sal_Unicode ***pValueList, sal_uInt32 *pLen) const
Definition: keyimpl.cxx:807
bool isReadOnly() const
Definition: regimpl.hxx:88
sal_uInt32 m_refCount
Definition: keyimpl.hxx:130
RegError getStringListValue(std::u16string_view valueName, char ***pValueList, sal_uInt32 *pLen) const
Definition: keyimpl.cxx:710
RegError setLongListValue(std::u16string_view valueName, sal_Int32 const *pValueList, sal_uInt32 len)
Definition: keyimpl.cxx:344
RegError setStringListValue(std::u16string_view valueName, char **pValueList, sal_uInt32 len)
Definition: keyimpl.cxx:399
enum SAL_DLLPUBLIC_RTTI RegError
specifies the possible error codes which can occur using the registry API.
Definition: regtype.h:82
RegError closeKey(RegKeyHandle hKey)
Definition: keyimpl.cxx:202
bool m_bDeleted
Definition: keyimpl.hxx:132
enum SAL_DLLPUBLIC_RTTI RegValueType
defines the type of a key value.
Definition: regtype.h:61
RegError getKeyNames(const OUString &keyName, rtl_uString ***pSubKeyNames, sal_uInt32 *pnSubKeys)
Definition: keyimpl.cxx:145
bool isReadOnly() const
Definition: keyimpl.hxx:111
RegError getValue(std::u16string_view valueName, RegValue value) const
Definition: keyimpl.cxx:528
store::OStoreDirectory getStoreDir() const
Definition: keyimpl.cxx:937
bool m_bModified
Definition: keyimpl.hxx:133
RegError createKey(const OUString &keyName, RegKeyHandle *phNewKey)
Definition: keyimpl.cxx:68
void setDeleted(bool bKeyDeleted)
Definition: keyimpl.hxx:102
sal_uInt32 countSubKeys()
Definition: keyimpl.cxx:915
OUString m_name
Definition: keyimpl.hxx:131
RegError setValue(std::u16string_view valueName, RegValueType vType, RegValue value, sal_uInt32 vSize)
Definition: keyimpl.cxx:273
void acquire()
Definition: keyimpl.hxx:37
RegError getLongListValue(std::u16string_view valueName, sal_Int32 **pValueList, sal_uInt32 *pLen) const
Definition: keyimpl.cxx:607
void * RegKeyHandle
defines the type of a registry key handle used in the C API.
Definition: regtype.h:30
ORegistry * getRegistry() const
Definition: keyimpl.hxx:116
void * RegValue
defines the type of a registry key value handle used in the C API.
Definition: regtype.h:33
RegError getValueInfo(std::u16string_view valueName, RegValueType *pValueTye, sal_uInt32 *pValueSize) const
Definition: keyimpl.cxx:218
sal_uInt32 release()
Definition: keyimpl.hxx:40
~ORegKey()
Definition: keyimpl.cxx:52
void setModified(bool bModified=true)
Definition: keyimpl.hxx:108
RegError openKey(const OUString &keyName, RegKeyHandle *phOpenKey)
Definition: keyimpl.cxx:76
const store::OStoreFile & getStoreFile() const
Definition: keyimpl.hxx:119
const store::OStoreFile & getStoreFile() const
Definition: regimpl.hxx:96
OUString getFullPath(OUString const &path) const
Definition: keyimpl.cxx:964
ORegistry * m_pRegistry
Definition: keyimpl.hxx:134