ObjFW
OFINICategory.h
1 /*
2  * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
3  * Jonathan Schleifer <js@webkeks.org>
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 OFString;
22 #ifndef DOXYGEN
23 @class OFArray OF_GENERIC(ObjectType);
24 @class OFMutableArray OF_GENERIC(ObjectType);
25 #endif
26 
33 {
34  OFString *_name;
35  OFMutableArray *_lines;
36 }
37 
38 #ifdef OF_HAVE_PROPERTIES
39 @property (copy) OFString *name;
40 #endif
41 
47 - (void)setName: (OFString*)name;
48 
54 - (OFString*)name;
55 
66 - (nullable OFString*)stringForKey: (OFString*)key;
67 
80 - (nullable OFString*)stringForKey: (OFString*)key
81  defaultValue: (nullable OFString*)defaultValue;
82 
95 - (intmax_t)integerForKey: (OFString*)key
96  defaultValue: (intmax_t)defaultValue;
97 
110 - (bool)boolForKey: (OFString*)key
111  defaultValue: (bool)defaultValue;
112 
125 - (float)floatForKey: (OFString*)key
126  defaultValue: (float)defaultValue;
127 
140 - (double)doubleForKey: (OFString*)key
141  defaultValue: (double)defaultValue;
142 
154 - (OFArray OF_GENERIC(OFString*)*)arrayForKey: (OFString*)key;
155 
165 - (void)setString: (OFString*)string
166  forKey: (OFString*)key;
167 
177 - (void)setInteger: (intmax_t)integer
178  forKey: (OFString*)key;
179 
189 - (void)setBool: (bool)bool_
190  forKey: (OFString*)key;
191 
201 - (void)setFloat: (float)float_
202  forKey: (OFString*)key;
203 
213 - (void)setDouble: (double)double_
214  forKey: (OFString*)key;
215 
228 - (void)setArray: (OFArray OF_GENERIC(OFString*)*)array
229  forKey: (OFString*)key;
230 
239 - (void)removeValueForKey: (OFString*)key;
240 @end
241 
242 OF_ASSUME_NONNULL_END
An abstract class for storing objects in an array.
Definition: OFArray.h:95
The root class for all other classes inside ObjFW.
Definition: OFObject.h:364
An abstract class for storing, adding and removing objects in an array.
Definition: OFMutableArray.h:46
A class for handling strings.
Definition: OFString.h:91
A class for representing a category of an INI file.
Definition: OFINICategory.h:32