ObjFW
Toggle main menu visibility
Loading...
Searching...
No Matches
OFSettings.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
22
OF_ASSUME_NONNULL_BEGIN
23
24
@class
OFString
;
25
@class
OFArray
OF_GENERIC(ObjectType);
26
38
@interface
OFSettings
:
OFObject
39
{
40
OFString
*_applicationName;
41
OF_RESERVE_IVARS(
OFSettings
, 4)
42
}
43
48
@property
(readonly, nonatomic)
OFString
*
applicationName
;
49
58
+ (instancetype)settingsWithApplicationName: (
OFString
*)applicationName;
59
60
- (instancetype)
init
OF_UNAVAILABLE;
61
70
- (instancetype)initWithApplicationName: (
OFString
*)applicationName
71
OF_DESIGNATED_INITIALIZER;
72
79
- (void)setString: (
OFString
*)string forPath: (
OFString
*)path;
80
87
- (void)setLongLong: (
long
long
)longLong forPath: (
OFString
*)path;
88
95
- (void)setUnsignedLongLong: (
unsigned
long
long
)unsignedLongLong
96
forPath: (
OFString
*)path;
97
104
- (void)setBool: (
bool
)bool_ forPath: (
OFString
*)path;
105
112
- (void)setFloat: (
float
)float_ forPath: (
OFString
*)path;
113
120
- (void)setDouble: (
double
)double_ forPath: (
OFString
*)path;
121
128
- (void)setStringArray: (
OFArray
OF_GENERIC(
OFString
*) *)array
129
forPath: (
OFString
*)path;
130
138
- (nullable
OFString
*)stringForPath: (
OFString
*)path;
139
148
- (nullable
OFString
*)stringForPath: (
OFString
*)path
149
defaultValue: (nullable
OFString
*)defaultValue;
150
159
- (
long
long)longLongForPath: (
OFString
*)path
160
defaultValue: (
long
long
)defaultValue;
161
170
- (
unsigned
long
long)unsignedLongLongForPath: (
OFString
*)path
171
defaultValue: (
unsigned
long
long
)defaultValue;
172
181
- (bool)boolForPath: (
OFString
*)path defaultValue: (
bool
)defaultValue;
182
191
- (float)floatForPath: (
OFString
*)path defaultValue: (
float
)defaultValue;
192
201
- (double)doubleForPath: (
OFString
*)path defaultValue: (
double
)defaultValue;
202
210
- (
OFArray
OF_GENERIC(
OFString
*) *)stringArrayForPath: (
OFString
*)path;
211
217
- (void)removeValueForPath: (
OFString
*)path;
218
227
- (void)
save
;
228
@end
229
230
OF_ASSUME_NONNULL_END
OFObject.h
OFArray
An abstract class for storing objects in an array.
Definition
OFArray.h:111
OFObject
The root class for all other classes inside ObjFW.
Definition
OFObject.h:956
-[OFObject init]
instancetype init()
Initializes an already allocated object.
Definition
OFObject.m:671
OFSettings
A class for storing and retrieving settings.
Definition
OFSettings.h:39
-[OFSettings save]
void save()
Saves the settings to disk.
Definition
OFSettings.m:154
OFSettings::applicationName
OFString * applicationName
The name of the application whose settings are accessed by the instance.
Definition
OFSettings.h:48
OFString
A class for handling strings.
Definition
OFString.h:144
src
OFSettings.h
Generated by
1.17.0