ObjFW
 
Loading...
Searching...
No Matches
OFINIFile.h
1/*
2 * Copyright (c) 2008-2026 Jonathan Schleifer <js@nil.im>
3 *
4 * All rights reserved.
5 *
6 * This program is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU Lesser General Public License version 3.0 only,
8 * as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
13 * version 3.0 for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * version 3.0 along with this program. If not, see
17 * <https://www.gnu.org/licenses/>.
18 */
19
20#import "OFObject.h"
21#import "OFString.h"
22#import "OFINISection.h"
23
24OF_ASSUME_NONNULL_BEGIN
25
26@class OFIRI;
27@class OFMutableArray OF_GENERIC(ObjectType);
28@class OFMutableDictionary OF_GENERIC(KeyType, ObjectType);
29
35OF_SUBCLASSING_RESTRICTED
37{
38 OFMutableArray OF_GENERIC(OFINISection *) *_sections;
40 *_sectionsMap;
41}
42
46@property (readonly, nonatomic) OFArray OF_GENERIC(OFINISection *) *sections;
47
53@property (readonly, nonatomic) OFArray OF_GENERIC(OFINISection *) *categories
54 OF_DEPRECATED(ObjFW, 1, 2, "Use -[sections] instead");
55
67+ (instancetype)fileWithIRI: (OFIRI *)IRI;
68
81+ (instancetype)fileWithIRI: (OFIRI *)IRI encoding: (OFStringEncoding)encoding;
82
83- (instancetype)init OF_UNAVAILABLE;
84
97- (instancetype)initWithIRI: (OFIRI *)IRI;
98
111- (instancetype)initWithIRI: (OFIRI *)IRI
112 encoding: (OFStringEncoding)encoding
113 OF_DESIGNATED_INITIALIZER;
114
123- (OFINISection *)sectionForName: (OFString *)name;
124
135- (OFINISection *)categoryForName: (OFString *)name
136 OF_DEPRECATED(ObjFW, 1, 2, "Use -[sectionForName:] instead");
137
143- (void)writeToIRI: (OFIRI *)IRI;
144
152- (void)writeToIRI: (OFIRI *)IRI encoding: (OFStringEncoding)encoding;
153@end
154
155OF_ASSUME_NONNULL_END
OFStringEncoding
The encoding of a string.
Definition OFString.h:65
An abstract class for storing objects in an array.
Definition OFArray.h:110
A class for reading, creating and modifying INI files.
Definition OFINIFile.h:37
OFArray * categories
All sections in the INI file.
Definition OFINIFile.m:105
OFArray * sections
All sections in the INI file.
Definition OFINIFile.h:46
A class for representing a section of an INI file.
Definition OFINISection.h:34
A class for representing IRIs, URIs, URLs and URNs, for parsing them as well as accessing parts of th...
Definition OFIRI.h:41
An abstract class for storing, adding and removing objects in an array.
Definition OFMutableArray.h:50
An abstract class for storing and changing objects in a dictionary.
Definition OFMutableDictionary.h:48
The root class for all other classes inside ObjFW.
Definition OFObject.h:956
instancetype init()
Initializes an already allocated object.
Definition OFObject.m:671
A class for handling strings.
Definition OFString.h:143