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
31{
32public:
33
34 ORegKey(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(std::u16string_view keyName, RegKeyHandle* phNewKey);
46
47 RegError openKey(std::u16string_view keyName, RegKeyHandle* phOpenKey);
48
49 RegError openSubKeys(std::u16string_view keyName,
50 RegKeyHandle** phOpenSubKeys,
51 sal_uInt32* pnSubKeys);
52
53 RegError getKeyNames(std::u16string_view keyName,
54 rtl_uString*** pSubKeyNames,
55 sal_uInt32* pnSubKeys);
56
58
59 RegError deleteKey(std::u16string_view 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(std::u16string_view 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(std::u16string_view path) const;
128
129private:
130 sal_uInt32 m_refCount;
131 OUString m_name;
135};
136
137#endif
138
139
140/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
RegError createKey(std::u16string_view keyName, RegKeyHandle *phNewKey)
Definition: keyimpl.cxx:57
sal_uInt32 m_refCount
Definition: keyimpl.hxx:130
RegError setUnicodeListValue(std::u16string_view valueName, sal_Unicode **pValueList, sal_uInt32 len)
Definition: keyimpl.cxx:423
void acquire()
Definition: keyimpl.hxx:37
ORegistry * getRegistry() const
Definition: keyimpl.hxx:116
RegError getValueInfo(std::u16string_view valueName, RegValueType *pValueTye, sal_uInt32 *pValueSize) const
Definition: keyimpl.cxx:189
RegError getValue(std::u16string_view valueName, RegValue value) const
Definition: keyimpl.cxx:484
void setModified(bool bModified=true)
Definition: keyimpl.hxx:108
bool isModified() const
Definition: keyimpl.hxx:105
RegError setLongListValue(std::u16string_view valueName, sal_Int32 const *pValueList, sal_uInt32 len)
Definition: keyimpl.cxx:309
OUString getFullPath(std::u16string_view path) const
Definition: keyimpl.cxx:908
RegError releaseKey(RegKeyHandle hKey)
Definition: keyimpl.cxx:52
RegError getResolvedKeyName(std::u16string_view keyName, OUString &resolvedName) const
Definition: keyimpl.cxx:849
sal_uInt32 countSubKeys()
Definition: keyimpl.cxx:859
RegError getStringListValue(std::u16string_view valueName, char ***pValueList, sal_uInt32 *pLen) const
Definition: keyimpl.cxx:660
RegError getKeyNames(std::u16string_view keyName, rtl_uString ***pSubKeyNames, sal_uInt32 *pnSubKeys)
Definition: keyimpl.cxx:125
bool isDeleted() const
Definition: keyimpl.hxx:99
RegError getLongListValue(std::u16string_view valueName, sal_Int32 **pValueList, sal_uInt32 *pLen) const
Definition: keyimpl.cxx:560
OUString m_name
Definition: keyimpl.hxx:131
RegError getUnicodeListValue(std::u16string_view valueName, sal_Unicode ***pValueList, sal_uInt32 *pLen) const
Definition: keyimpl.cxx:754
const store::OStoreFile & getStoreFile() const
Definition: keyimpl.hxx:119
ORegKey(OUString keyName, ORegistry *pReg)
Definition: keyimpl.cxx:38
~ORegKey()
Definition: keyimpl.cxx:47
RegError setValue(std::u16string_view valueName, RegValueType vType, RegValue value, sal_uInt32 vSize)
Definition: keyimpl.cxx:241
void setDeleted(bool bKeyDeleted)
Definition: keyimpl.hxx:102
bool m_bDeleted
Definition: keyimpl.hxx:132
sal_uInt32 release()
Definition: keyimpl.hxx:40
RegError openKey(std::u16string_view keyName, RegKeyHandle *phOpenKey)
Definition: keyimpl.cxx:62
RegError deleteKey(std::u16string_view keyName)
Definition: keyimpl.cxx:184
RegError openSubKeys(std::u16string_view keyName, RegKeyHandle **phOpenSubKeys, sal_uInt32 *pnSubKeys)
Definition: keyimpl.cxx:67
RegError setStringListValue(std::u16string_view valueName, char **pValueList, sal_uInt32 len)
Definition: keyimpl.cxx:361
bool isReadOnly() const
Definition: keyimpl.hxx:111
RegError closeKey(RegKeyHandle hKey)
Definition: keyimpl.cxx:179
bool m_bModified
Definition: keyimpl.hxx:133
ORegistry * m_pRegistry
Definition: keyimpl.hxx:134
const OUString & getName() const
Definition: keyimpl.hxx:124
store::OStoreDirectory getStoreDir() const
Definition: keyimpl.cxx:881
const store::OStoreFile & getStoreFile() const
Definition: regimpl.hxx:89
bool isReadOnly() const
Definition: regimpl.hxx:81
void * RegKeyHandle
defines the type of a registry key handle used in the C API.
Definition: regtype.h:29
enum SAL_DLLPUBLIC_RTTI RegValueType
defines the type of a key value.
Definition: regtype.h:61
void * RegValue
defines the type of a registry key value handle used in the C API.
Definition: regtype.h:32
enum SAL_DLLPUBLIC_RTTI RegError
specifies the possible error codes which can occur using the registry API.
Definition: regtype.h:82
sal_uInt16 sal_Unicode