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 "regimpl.hxx"
24 #include <rtl/ustring.hxx>
25 
26 class ORegKey
27 {
28 public:
29 
30  ORegKey(const OUString& keyName, ORegistry* pReg);
31  ~ORegKey();
32 
33  void acquire()
34  { ++m_refCount; }
35 
36  sal_uInt32 release()
37  { return --m_refCount; }
38 
40 
41  RegError createKey(const OUString& keyName, RegKeyHandle* phNewKey);
42 
43  RegError openKey(const OUString& keyName, RegKeyHandle* phOpenKey);
44 
45  RegError openSubKeys(const OUString& keyName,
46  RegKeyHandle** phOpenSubKeys,
47  sal_uInt32* pnSubKeys);
48 
49  RegError getKeyNames(const OUString& keyName,
50  rtl_uString*** pSubKeyNames,
51  sal_uInt32* pnSubKeys);
52 
54 
55  RegError deleteKey(const OUString& keyName);
56 
57  RegError getValueInfo(const OUString& valueName,
58  RegValueType* pValueTye,
59  sal_uInt32* pValueSize) const;
60 
61  RegError setValue(const OUString& valueName,
62  RegValueType vType,
63  RegValue value,
64  sal_uInt32 vSize);
65 
66  RegError setLongListValue(const OUString& valueName,
67  sal_Int32 const * pValueList,
68  sal_uInt32 len);
69 
70  RegError setStringListValue(const OUString& valueName,
71  char** pValueList,
72  sal_uInt32 len);
73 
74  RegError setUnicodeListValue(const OUString& valueName,
75  sal_Unicode** pValueList,
76  sal_uInt32 len);
77 
78  RegError getValue(const OUString& valueName, RegValue value) const;
79 
80  RegError getLongListValue(const OUString& valueName,
81  sal_Int32** pValueList,
82  sal_uInt32* pLen) const;
83 
84  RegError getStringListValue(const OUString& valueName,
85  char*** pValueList,
86  sal_uInt32* pLen) const;
87 
88  RegError getUnicodeListValue(const OUString& valueName,
89  sal_Unicode*** pValueList,
90  sal_uInt32* pLen) const;
91 
92  RegError getResolvedKeyName(const OUString& keyName,
93  OUString& resolvedName) const;
94 
95  bool isDeleted() const
96  { return m_bDeleted; }
97 
98  void setDeleted (bool bKeyDeleted)
99  { m_bDeleted = bKeyDeleted; }
100 
101  bool isModified() const
102  { return m_bModified; }
103 
104  void setModified (bool bModified = true)
105  { m_bModified = bModified; }
106 
107  bool isReadOnly() const
108  { return m_pRegistry->isReadOnly(); }
109 
110  sal_uInt32 countSubKeys();
111 
113  { return m_pRegistry; }
114 
116  { return m_pRegistry->getStoreFile(); }
117 
119 
120  const OUString& getName() const
121  { return m_name; }
122 
123  OUString getFullPath(OUString const & path) const;
124 
125 private:
126  sal_uInt32 m_refCount;
127  OUString m_name;
128  bool m_bDeleted:1;
129  bool m_bModified:1;
131 };
132 
133 #endif
134 
135 
136 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const OUString & getName() const
Definition: keyimpl.hxx:120
RegError setUnicodeListValue(const OUString &valueName, sal_Unicode **pValueList, sal_uInt32 len)
Definition: keyimpl.cxx:465
RegError setValue(const OUString &valueName, RegValueType vType, RegValue value, sal_uInt32 vSize)
Definition: keyimpl.cxx:275
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:101
RegError getResolvedKeyName(const OUString &keyName, OUString &resolvedName) const
Definition: keyimpl.cxx:909
RegError deleteKey(const OUString &keyName)
Definition: keyimpl.cxx:212
RegError releaseKey(RegKeyHandle hKey)
Definition: keyimpl.cxx:60
bool isDeleted() const
Definition: keyimpl.hxx:95
sal_uInt16 sal_Unicode
bool isReadOnly() const
Definition: regimpl.hxx:85
sal_uInt32 m_refCount
Definition: keyimpl.hxx:126
enum SAL_DLLPUBLIC_RTTI RegError
specifies the possible error codes which can occur using the registry API.
Definition: regtype.h:80
RegError closeKey(RegKeyHandle hKey)
Definition: keyimpl.cxx:204
bool m_bDeleted
Definition: keyimpl.hxx:128
enum SAL_DLLPUBLIC_RTTI RegValueType
defines the type of a key value.
Definition: regtype.h:59
RegError getKeyNames(const OUString &keyName, rtl_uString ***pSubKeyNames, sal_uInt32 *pnSubKeys)
Definition: keyimpl.cxx:145
bool isReadOnly() const
Definition: keyimpl.hxx:107
store::OStoreDirectory getStoreDir() const
Definition: keyimpl.cxx:944
RegError setStringListValue(const OUString &valueName, char **pValueList, sal_uInt32 len)
Definition: keyimpl.cxx:401
RegError getValue(const OUString &valueName, RegValue value) const
Definition: keyimpl.cxx:529
bool m_bModified
Definition: keyimpl.hxx:129
RegError createKey(const OUString &keyName, RegKeyHandle *phNewKey)
Definition: keyimpl.cxx:68
void setDeleted(bool bKeyDeleted)
Definition: keyimpl.hxx:98
sal_uInt32 countSubKeys()
Definition: keyimpl.cxx:922
OUString m_name
Definition: keyimpl.hxx:127
RegError getUnicodeListValue(const OUString &valueName, sal_Unicode ***pValueList, sal_uInt32 *pLen) const
Definition: keyimpl.cxx:814
RegError getValueInfo(const OUString &valueName, RegValueType *pValueTye, sal_uInt32 *pValueSize) const
Definition: keyimpl.cxx:220
RegError getLongListValue(const OUString &valueName, sal_Int32 **pValueList, sal_uInt32 *pLen) const
Definition: keyimpl.cxx:614
void acquire()
Definition: keyimpl.hxx:33
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:112
void * RegValue
defines the type of a registry key value handle used in the C API.
Definition: regtype.h:33
sal_uInt32 release()
Definition: keyimpl.hxx:36
RegError setLongListValue(const OUString &valueName, sal_Int32 const *pValueList, sal_uInt32 len)
Definition: keyimpl.cxx:346
RegError getStringListValue(const OUString &valueName, char ***pValueList, sal_uInt32 *pLen) const
Definition: keyimpl.cxx:717
~ORegKey()
Definition: keyimpl.cxx:52
void setModified(bool bModified=true)
Definition: keyimpl.hxx:104
RegError openKey(const OUString &keyName, RegKeyHandle *phOpenKey)
Definition: keyimpl.cxx:76
const store::OStoreFile & getStoreFile() const
Definition: keyimpl.hxx:115
const store::OStoreFile & getStoreFile() const
Definition: regimpl.hxx:93
OUString getFullPath(OUString const &path) const
Definition: keyimpl.cxx:971
ORegistry * m_pRegistry
Definition: keyimpl.hxx:130