ObjFW
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 
25 OF_ASSUME_NONNULL_BEGIN
26 
27 @class OFData;
28 
32 OF_SUBCLASSING_RESTRICTED
33 @interface OFWindowsRegistryKey: OFObject
34 {
35  HKEY _hKey;
36  bool _close;
37 }
38 
44 + (instancetype)classesRootKey;
45 
51 + (instancetype)currentConfigKey;
52 
58 + (instancetype)currentUserKey;
59 
65 + (instancetype)localMachineKey;
66 
72 + (instancetype)usersKey;
73 
74 - (instancetype)init OF_UNAVAILABLE;
75 
87 - (OFWindowsRegistryKey *)openSubkeyAtPath: (OFString *)path
88  accessRights: (REGSAM)accessRights
89  options: (DWORD)options;
109 - (OFWindowsRegistryKey *)
110  createSubkeyAtPath: (OFString *)path
111  accessRights: (REGSAM)accessRights
112  securityAttributes: (nullable SECURITY_ATTRIBUTES *)securityAttributes
113  options: (DWORD)options
114  disposition: (nullable DWORD *)disposition;
115 
124 - (nullable OFData *)dataForValueNamed: (nullable OFString *)name
125  type: (nullable DWORD *)type;
126 
135 - (void)setData: (nullable OFData *)data
136  forValueNamed: (nullable OFString *)name
137  type: (DWORD)type;
138 
147 - (nullable OFString *)stringForValueNamed: (nullable OFString *)name;
148 
158 - (nullable OFString *)stringForValueNamed: (nullable OFString *)name
159  type: (nullable DWORD *)type;
160 
168 - (void)setString: (nullable OFString *)string
169  forValueNamed: (nullable OFString *)name;
170 
179 - (void)setString: (nullable OFString *)string
180  forValueNamed: (nullable OFString *)name
181  type: (DWORD)type;
182 
191 - (uint32_t)DWORDForValueNamed: (nullable OFString *)name;
192 
200 - (void)setDWORD: (uint32_t)dword forValueNamed: (nullable OFString *)name;
201 
210 - (uint64_t)QWORDForValueNamed: (nullable OFString *)name;
211 
219 - (void)setQWORD: (uint64_t)qword forValueNamed: (nullable OFString *)name;
220 
227 - (void)deleteValueNamed: (nullable OFString *)name;
228 
235 - (void)deleteSubkeyAtPath: (OFString *)subkeyPath;
236 @end
237 
238 OF_ASSUME_NONNULL_END
The root class for all other classes inside ObjFW.
Definition: OFObject.h:690
A class for handling strings.
Definition: OFString.h:142
A class for storing arbitrary data in an array.
Definition: OFData.h:45