ObjFW
OFINIFile.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 #import "OFString.h"
19 #import "OFINICategory.h"
20 
21 OF_ASSUME_NONNULL_BEGIN
22 
23 @class OFMutableArray OF_GENERIC(ObjectType);
24 
30 @interface OFINIFile: OFObject
31 {
32  OFMutableArray OF_GENERIC(OFINICategory *) *_categories;
33 }
34 
42 + (instancetype)fileWithPath: (OFString *)path;
43 
53 + (instancetype)fileWithPath: (OFString *)path
54  encoding: (of_string_encoding_t)encoding;
55 
56 - init OF_UNAVAILABLE;
57 
66 - initWithPath: (OFString *)path;
67 
77 - initWithPath: (OFString *)path
78  encoding: (of_string_encoding_t)encoding OF_DESIGNATED_INITIALIZER;
79 
89 - (OFINICategory *)categoryForName: (OFString *)name;
90 
96 - (void)writeToFile: (OFString *)path;
97 
105 - (void)writeToFile: (OFString *)path
106  encoding: (of_string_encoding_t)encoding;
107 @end
108 
109 OF_ASSUME_NONNULL_END
A class for representing a category of an INI file.
Definition: OFINICategory.h:30
A class for handling strings.
Definition: OFString.h:114
A class for reading, creating and modifying INI files.
Definition: OFINIFile.h:30
id init()
Initializes an already allocated object.
Definition: OFObject.m:488
The root class for all other classes inside ObjFW.
Definition: OFObject.h:379
of_string_encoding_t
The encoding of a string.
Definition: OFString.h:53
An abstract class for storing, adding and removing objects in an array.
Definition: OFMutableArray.h:40