ObjFW  Diff

Differences From Artifact [612a70eebb]:

  • File src/OFSettings.h — part of check-in [cfd374b906] at 2015-01-03 20:57:18 on branch trunk — Update copyright (user: js size: 6433)

To Artifact [0d8a20bfc8]:

  • File src/OFSettings.h — part of check-in [5329fe7c1a] at 2015-06-12 23:59:20 on branch trunk — Add support for and use the new ObjC generics (user: js size: 6500)

13
14
15
16
17
18
19
20

21
22
23
24
25
26
27
13
14
15
16
17
18
19

20
21
22
23
24
25
26
27







-
+







 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFObject.h"

@class OFString;
@class OFArray;
@class OFArray OF_GENERIC(ObjectType);

/*!
 * @class OFSettings OFSettings.h ObjFW/OFSettings.h
 *
 * Paths are delimited by dots, for example `category.subcategory.key`.
 *
 * @note The behaviour when accessing a path with a different type than it has
115
116
117
118
119
120
121
122

123
124
125
126
127
128
129
115
116
117
118
119
120
121

122
123
124
125
126
127
128
129







-
+








/*!
 * @brief Sets the specified path to the specified array of strings.
 *
 * @param array The array of strings to set
 * @param path The path to store the array of strings at
 */
- (void)setArray: (OFArray*)array
- (void)setArray: (OFArray OF_GENERIC(OFString*)*)array
	 forPath: (OFString*)path;

/*!
 * @brief Returns the string for the specified path, or nil if the path does
 *	  not exist.
 *
 * @param path The path for which the string value should be returned
189
190
191
192
193
194
195
196

197
198
199
200
201
202
203
189
190
191
192
193
194
195

196
197
198
199
200
201
202
203







-
+







/*!
 * @brief Returns the array of strings for the specified path, or an empty
 *	  array if the path does not exist.
 *
 * @param path The path for which the array of strings should be returned
 * @return The array of strings of the specified path
 */
- (OFArray*)arrayForPath: (OFString*)path;
- (OFArray OF_GENERIC(OFString*)*)arrayForPath: (OFString*)path;

/*!
 * @brief Removes the value for the specified path.
 *
 * @param path The path for which the value should be removed
 */
- (void)removeValueForPath: (OFString*)path;