ObjFW
OFINICategory.h
1 /*
2  * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017
3  * Jonathan Schleifer <js@heap.zone>
4  *
5  * All rights reserved.
6  *
7  * This file is part of ObjFW. It may be distributed under the terms of the
8  * Q Public License 1.0, which can be found in the file LICENSE.QPL included in
9  * the packaging of this file.
10  *
11  * Alternatively, it may be distributed under the terms of the GNU General
12  * Public License, either version 2 or 3, which can be found in the file
13  * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
14  * file.
15  */
16 
17 #import "OFObject.h"
18 
19 OF_ASSUME_NONNULL_BEGIN
20 
21 @class OFArray OF_GENERIC(ObjectType);
22 @class OFMutableArray OF_GENERIC(ObjectType);
23 @class OFString;
24 
31 {
32  OFString *_name;
33  OFMutableArray *_lines;
34 }
35 
39 @property (nonatomic, copy) OFString *name;
40 
41 - init OF_UNAVAILABLE;
42 
53 - (nullable OFString *)stringForKey: (OFString *)key;
54 
67 - (nullable OFString *)stringForKey: (OFString *)key
68  defaultValue: (nullable OFString *)defaultValue;
69 
82 - (intmax_t)integerForKey: (OFString *)key
83  defaultValue: (intmax_t)defaultValue;
84 
97 - (bool)boolForKey: (OFString *)key
98  defaultValue: (bool)defaultValue;
99 
112 - (float)floatForKey: (OFString *)key
113  defaultValue: (float)defaultValue;
114 
127 - (double)doubleForKey: (OFString *)key
128  defaultValue: (double)defaultValue;
129 
141 - (OFArray OF_GENERIC(OFString *) *)arrayForKey: (OFString *)key;
142 
152 - (void)setString: (OFString *)string
153  forKey: (OFString *)key;
154 
164 - (void)setInteger: (intmax_t)integer
165  forKey: (OFString *)key;
166 
176 - (void)setBool: (bool)bool_
177  forKey: (OFString *)key;
178 
188 - (void)setFloat: (float)float_
189  forKey: (OFString *)key;
190 
200 - (void)setDouble: (double)double_
201  forKey: (OFString *)key;
202 
215 - (void)setArray: (OFArray OF_GENERIC(OFString *) *)array
216  forKey: (OFString *)key;
217 
226 - (void)removeValueForKey: (OFString *)key;
227 @end
228 
229 OF_ASSUME_NONNULL_END
A class for representing a category of an INI file.
Definition: OFINICategory.h:30
id copy()
Returns the class.
Definition: OFObject.m:1133
OFString * name
Definition: OFINICategory.h:39
A class for handling strings.
Definition: OFString.h:114
id init()
Initializes an already allocated object.
Definition: OFObject.m:488
The root class for all other classes inside ObjFW.
Definition: OFObject.h:379
An abstract class for storing objects in an array.
Definition: OFArray.h:89
An abstract class for storing, adding and removing objects in an array.
Definition: OFMutableArray.h:40