ObjFW
OFINICategory.h
1 /*
2  * Copyright (c) 2008-2021 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 
18 OF_ASSUME_NONNULL_BEGIN
19 
20 @class OFArray OF_GENERIC(ObjectType);
21 @class OFMutableArray OF_GENERIC(ObjectType);
22 @class OFString;
23 
29 OF_SUBCLASSING_RESTRICTED
31 {
32  OFString *_name;
33  OFMutableArray *_lines;
34 }
35 
39 @property (copy, nonatomic) OFString *name;
40 
41 - (instancetype)init OF_UNAVAILABLE;
42 
53 - (nullable OFString *)stringForKey: (OFString *)key;
54 
67 - (nullable OFString *)stringForKey: (OFString *)key
68  defaultValue: (nullable OFString *)defaultValue;
69 
82 - (long long)longLongForKey: (OFString *)key
83  defaultValue: (long long)defaultValue;
84 
97 - (bool)boolForKey: (OFString *)key defaultValue: (bool)defaultValue;
98 
111 - (float)floatForKey: (OFString *)key defaultValue: (float)defaultValue;
112 
125 - (double)doubleForKey: (OFString *)key defaultValue: (double)defaultValue;
126 
138 - (OFArray OF_GENERIC(OFString *) *)stringArrayForKey: (OFString *)key;
139 
149 - (void)setString: (OFString *)string forKey: (OFString *)key;
150 
160 - (void)setLongLong: (long long)longLong forKey: (OFString *)key;
161 
171 - (void)setBool: (bool)bool_ forKey: (OFString *)key;
172 
182 - (void)setFloat: (float)float_ forKey: (OFString *)key;
183 
193 - (void)setDouble: (double)double_ forKey: (OFString *)key;
194 
207 - (void)setStringArray: (OFArray OF_GENERIC(OFString *) *)array
208  forKey: (OFString *)key;
209 
218 - (void)removeValueForKey: (OFString *)key;
219 @end
220 
221 OF_ASSUME_NONNULL_END
An abstract class for storing objects in an array.
Definition: OFArray.h:92
A class for representing a category of an INI file.
Definition: OFINICategory.h:31
An abstract class for storing, adding and removing objects in an array.
Definition: OFMutableArray.h:44
The root class for all other classes inside ObjFW.
Definition: OFObject.h:520
A class for handling strings.
Definition: OFString.h:132