ObjFW
OFWindowsRegistryKey.h
1 /*
2  * Copyright (c) 2008-2024 Jonathan Schleifer <js@nil.im>
3  *
4  * All rights reserved.
5  *
6  * This file is part of ObjFW. It may be distributed under the terms of the
7  * Q Public License 1.0, which can be found in the file LICENSE.QPL included in
8  * the packaging of this file.
9  *
10  * Alternatively, it may be distributed under the terms of the GNU General
11  * Public License, either version 2 or 3, which can be found in the file
12  * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
13  * file.
14  */
15 
16 #import "OFObject.h"
17 #import "OFString.h"
18 
19 #include <windows.h>
20 
21 OF_ASSUME_NONNULL_BEGIN
22 
23 @class OFData;
24 
29 OF_SUBCLASSING_RESTRICTED
30 @interface OFWindowsRegistryKey: OFObject
31 {
32  HKEY _hKey;
33  bool _close;
34 }
35 
41 + (instancetype)classesRootKey;
42 
48 + (instancetype)currentConfigKey;
49 
55 + (instancetype)currentUserKey;
56 
62 + (instancetype)localMachineKey;
63 
69 + (instancetype)usersKey;
70 
71 - (instancetype)init OF_UNAVAILABLE;
72 
84 - (OFWindowsRegistryKey *)openSubkeyAtPath: (OFString *)path
85  accessRights: (REGSAM)accessRights
86  options: (DWORD)options;
106 - (OFWindowsRegistryKey *)
107  createSubkeyAtPath: (OFString *)path
108  accessRights: (REGSAM)accessRights
109  securityAttributes: (nullable SECURITY_ATTRIBUTES *)securityAttributes
110  options: (DWORD)options
111  disposition: (nullable DWORD *)disposition;
112 
121 - (nullable OFData *)dataForValueNamed: (nullable OFString *)name
122  type: (nullable DWORD *)type;
123 
132 - (void)setData: (nullable OFData *)data
133  forValueNamed: (nullable OFString *)name
134  type: (DWORD)type;
135 
144 - (nullable OFString *)stringForValueNamed: (nullable OFString *)name;
145 
155 - (nullable OFString *)stringForValueNamed: (nullable OFString *)name
156  type: (nullable DWORD *)type;
157 
165 - (void)setString: (nullable OFString *)string
166  forValueNamed: (nullable OFString *)name;
167 
176 - (void)setString: (nullable OFString *)string
177  forValueNamed: (nullable OFString *)name
178  type: (DWORD)type;
179 
188 - (uint32_t)DWORDForValueNamed: (nullable OFString *)name;
189 
197 - (void)setDWORD: (uint32_t)dword forValueNamed: (nullable OFString *)name;
198 
207 - (uint64_t)QWORDForValueNamed: (nullable OFString *)name;
208 
216 - (void)setQWORD: (uint64_t)qword forValueNamed: (nullable OFString *)name;
217 
224 - (void)deleteValueNamed: (nullable OFString *)name;
225 
232 - (void)deleteSubkeyAtPath: (OFString *)subkeyPath;
233 @end
234 
235 OF_ASSUME_NONNULL_END
A class for storing arbitrary data in an array.
Definition: OFData.h:42
The root class for all other classes inside ObjFW.
Definition: OFObject.h:688
A class for handling strings.
Definition: OFString.h:135