ObjFW
OFINICategory.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 
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 *)stringValueForKey: (OFString *)key;
54 
67 - (nullable OFString *)stringValueForKey: (OFString *)key
68  defaultValue: (nullable OFString *)defaultValue;
69 
84 - (long long)longLongValueForKey: (OFString *)key
85  defaultValue: (long long)defaultValue;
86 
101 - (bool)boolValueForKey: (OFString *)key defaultValue: (bool)defaultValue;
102 
117 - (float)floatValueForKey: (OFString *)key defaultValue: (float)defaultValue;
118 
133 - (double)doubleValueForKey: (OFString *)key defaultValue: (double)defaultValue;
134 
146 - (OFArray OF_GENERIC(OFString *) *)arrayValueForKey: (OFString *)key;
147 
157 - (void)setStringValue: (OFString *)stringValue forKey: (OFString *)key;
158 
168 - (void)setLongLongValue: (long long)longLongValue forKey: (OFString *)key;
169 
179 - (void)setBoolValue: (bool)boolValue forKey: (OFString *)key;
180 
190 - (void)setFloatValue: (float)floatValue forKey: (OFString *)key;
191 
201 - (void)setDoubleValue: (double)doubleValue forKey: (OFString *)key;
202 
215 - (void)setArrayValue: (OFArray OF_GENERIC(OFString *) *)arrayValue
216  forKey: (OFString *)key;
217 
226 - (void)removeValueForKey: (OFString *)key;
227 @end
228 
229 OF_ASSUME_NONNULL_END
An abstract class for storing objects in an array.
Definition: OFArray.h:103
The root class for all other classes inside ObjFW.
Definition: OFObject.h:686
An abstract class for storing, adding and removing objects in an array.
Definition: OFMutableArray.h:43
A class for handling strings.
Definition: OFString.h:134
A class for representing a category of an INI file.
Definition: OFINICategory.h:30