ObjFW  Diff

Differences From Artifact [a97b607515]:

To Artifact [e752ad4a7b]:


18
19
20
21
22
23
24


25
26
27
28
29
30
31
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33







+
+







#import "OFObject.h"
#import "OFString.h"

#include <windows.h>

OF_ASSUME_NONNULL_BEGIN

@class OFData;

/*!
 * @class OFWindowsRegistryKey \
 *	  OFWindowsRegistryKey.h ObjFW/OFWindowsRegistryKey.h
 */
@interface OFWindowsRegistryKey: OFObject
{
	HKEY _hKey;
66
67
68
69
70
71
72
73

74
75

76
77
78

79
80
81
82
83
84
85

86
87

88
89
90
91

92
93
94
95
96
97
98
99

100
101
102

103
104
105

106
107
108
109
110
111
112

113
114
115

116
117
118
119
120
121
122
123
124

125
126
127
128
129
130
131
132
133
134
135
136
137

138
139
140
141

142
143
144

145
146
147

148
149
150

151
152
153
154
155




156
157
158
68
69
70
71
72
73
74

75
76

77
78
79

80
81
82
83
84
85
86

87
88

89
90
91
92

93
94
95
96
97
98
99
100

101
102
103

104
105
106

107
108
109
110
111
112
113

114
115
116

117
118
119
120
121
122
123
124
125

126
127
128
129
130
131
132
133
134
135
136
137
138

139
140
141
142

143
144
145

146
147
148

149
150
151

152
153




154
155
156
157
158
159
160







-
+

-
+


-
+






-
+

-
+



-
+







-
+


-
+


-
+






-
+


-
+








-
+












-
+



-
+


-
+


-
+


-
+

-
-
-
-
+
+
+
+



 * @return The OFWindowsRegistryKey for the HKEY_USERS key
 */
+ (instancetype)usersKey;

- (instancetype)init OF_UNAVAILABLE;

/*!
 * @brief Opens the sub key at the specified path.
 * @brief Opens the subkey at the specified path.
 *
 * @param path The path of the sub key to open
 * @param path The path of the subkey to open
 * @param securityAndAccessRights Please refer to the `RegOpenKeyEx()`
 *				  documentation
 * @return The sub key with the specified path, or nil if it does not exist
 * @return The subkey with the specified path, or nil if it does not exist
 */
- (nullable OFWindowsRegistryKey *)
	 openSubKeyWithPath: (OFString *)path
    securityAndAccessRights: (REGSAM)securityAndAccessRights;

/*!
 * @brief Opens the sub key at the specified path.
 * @brief Opens the subkey at the specified path.
 *
 * @param path The path of the sub key to open
 * @param path The path of the subkey to open
 * @param options Please refer to the `RegOpenKeyEx()` documentation. Usually 0.
 * @param securityAndAccessRights Please refer to the `RegOpenKeyEx()`
 *				  documentation
 * @return The sub key with the specified path, or nil if it does not exist
 * @return The subkey with the specified path, or nil if it does not exist
 */
- (nullable OFWindowsRegistryKey *)
	 openSubKeyWithPath: (OFString *)path
		    options: (DWORD)options
    securityAndAccessRights: (REGSAM)securityAndAccessRights;

/*!
 * @brief Creates a sub key at the specified path or opens it if it already
 * @brief Creates a subkey at the specified path or opens it if it already
 *	  exists.
 *
 * @param path The path of the sub key to create
 * @param path The path of the subkey to create
 * @param securityAndAccessRights Please refer to the `RegCreateKeyEx()`
 *				  documentation
 * @return The sub key with the specified path
 * @return The subkey with the specified path
 */
- (OFWindowsRegistryKey *)
       createSubKeyWithPath: (OFString *)path
    securityAndAccessRights: (REGSAM)securityAndAccessRights;

/*!
 * @brief Creates a sub key at the specified path or opens it if it already
 * @brief Creates a subkey at the specified path or opens it if it already
 *	  exists.
 *
 * @param path The path of the sub key to create
 * @param path The path of the subkey to create
 * @param options Please refer to the `RegCreateKeyEx()` documentation.
 *		  Usually 0.
 * @param securityAndAccessRights Please refer to the `RegCreateKeyEx()`
 *				  documentation
 * @param securityAttributes Please refer to the `RegCreateKeyEx()`
 *			     documentation. Usually NULL.
 * @param disposition Whether the key was created or already existed. Please
 *		      refer to the `RegCreateKeyEx()` documentation.
 * @return The sub key with the specified path
 * @return The subkey with the specified path
 */
- (OFWindowsRegistryKey *)
       createSubKeyWithPath: (OFString *)path
		    options: (DWORD)options
    securityAndAccessRights: (REGSAM)securityAndAccessRights
	 securityAttributes: (nullable LPSECURITY_ATTRIBUTES)securityAttributes
		disposition: (nullable LPDWORD)disposition;

/*!
 * @brief Returns the string for the specified value at the specified path.
 *
 * @param value The name of the value to return
 * @param subKeyPath The path of the key from which to retrieve the value
 * @param subkeyPath The path of the key from which to retrieve the value
 * @return The string for the specified value
 */
- (nullable OFString *)stringForValue: (nullable OFString *)value
			   subKeyPath: (nullable OFString *)subKeyPath;
			   subkeyPath: (nullable OFString *)subkeyPath;

/*!
 * @brief Returns the string for the specified value at the specified path.
 * @brief Returns the data for the specified value at the specified path.
 *
 * @param value The name of the value to return
 * @param subKeyPath The path of the key from which to retrieve the value
 * @param subkeyPath The path of the key from which to retrieve the value
 * @param flags Extra flags for `RegGetValue()`. Usually 0.
 * @param type A pointer to store the type of the value, or NULL
 * @return The string for the specified value
 * @return The data for the specified value
 */
- (nullable OFString *)stringForValue: (nullable OFString *)value
			   subKeyPath: (nullable OFString *)subKeyPath
				flags: (DWORD)flags
				 type: (nullable LPDWORD)type;
- (nullable OFData *)dataForValue: (nullable OFString *)value
		       subkeyPath: (nullable OFString *)subkeyPath
			    flags: (DWORD)flags
			     type: (nullable LPDWORD)type;
@end

OF_ASSUME_NONNULL_END