ObjFW
Loading...
Searching...
No Matches
OFWindowsRegistryKey.h
1/*
2 * Copyright (c) 2008-2024 Jonathan Schleifer <js@nil.im>
3 *
4 * All rights reserved.
5 *
6 * This program is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU Lesser General Public License version 3.0 only,
8 * as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
13 * version 3.0 for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * version 3.0 along with this program. If not, see
17 * <https://www.gnu.org/licenses/>.
18 */
19
20#import "OFObject.h"
21#import "OFString.h"
22
23#include <windows.h>
24
25OF_ASSUME_NONNULL_BEGIN
26
27@class OFData;
28
33OF_SUBCLASSING_RESTRICTED
34@interface OFWindowsRegistryKey: OFObject
35{
36 HKEY _hKey;
37 bool _close;
38}
39
45+ (instancetype)classesRootKey;
46
52+ (instancetype)currentConfigKey;
53
59+ (instancetype)currentUserKey;
60
66+ (instancetype)localMachineKey;
67
73+ (instancetype)usersKey;
74
75- (instancetype)init OF_UNAVAILABLE;
76
88- (OFWindowsRegistryKey *)openSubkeyAtPath: (OFString *)path
89 accessRights: (REGSAM)accessRights
90 options: (DWORD)options;
110- (OFWindowsRegistryKey *)
111 createSubkeyAtPath: (OFString *)path
112 accessRights: (REGSAM)accessRights
113 securityAttributes: (nullable SECURITY_ATTRIBUTES *)securityAttributes
114 options: (DWORD)options
115 disposition: (nullable DWORD *)disposition;
116
125- (nullable OFData *)dataForValueNamed: (nullable OFString *)name
126 type: (nullable DWORD *)type;
127
136- (void)setData: (nullable OFData *)data
137 forValueNamed: (nullable OFString *)name
138 type: (DWORD)type;
139
148- (nullable OFString *)stringForValueNamed: (nullable OFString *)name;
149
159- (nullable OFString *)stringForValueNamed: (nullable OFString *)name
160 type: (nullable DWORD *)type;
161
169- (void)setString: (nullable OFString *)string
170 forValueNamed: (nullable OFString *)name;
171
180- (void)setString: (nullable OFString *)string
181 forValueNamed: (nullable OFString *)name
182 type: (DWORD)type;
183
192- (uint32_t)DWORDForValueNamed: (nullable OFString *)name;
193
201- (void)setDWORD: (uint32_t)dword forValueNamed: (nullable OFString *)name;
202
211- (uint64_t)QWORDForValueNamed: (nullable OFString *)name;
212
220- (void)setQWORD: (uint64_t)qword forValueNamed: (nullable OFString *)name;
221
228- (void)deleteValueNamed: (nullable OFString *)name;
229
236- (void)deleteSubkeyAtPath: (OFString *)subkeyPath;
237@end
238
239OF_ASSUME_NONNULL_END
A class for storing arbitrary data in an array.
Definition OFData.h:46
The root class for all other classes inside ObjFW.
Definition OFObject.h:692
A class for handling strings.
Definition OFString.h:139