Modified Doxyfile
from [36e288b969]
to [acb8142762].
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
+
-
+
-
+
|
PROJECT_NAME = "ObjFW"
OUTPUT_DIRECTORY = docs/
INPUT = src src/exceptions
FILE_PATTERNS = *.h *.m
HTML_OUTPUT = .
GENERATE_LATEX = NO
HIDE_UNDOC_CLASSES = YES
HIDE_UNDOC_MEMBERS = YES
PREDEFINED = DOXYGEN \
PREDEFINED = OF_HAVE_BLOCKS \
OF_HAVE_BLOCKS \
OF_HAVE_FILES \
OF_HAVE_OPTIONAL_PROTOCOLS \
OF_HAVE_PROPERTIES \
OF_HAVE_SOCKETS \
OF_HAVE_THREADS \
OF_METHOD_NORETURN \
OF_NO_RETURN \
OF_NO_RETURN_FUNC
OF_NO_RETURN_FUNC \
OF_SENTINEL \
OF_REQUIRES_SUPER \
OF_RETURNS_RETAINED \
OF_RETURNS_NOT_RETAINED \
OF_RETURNS_INNER_POINTER \
OF_ROOT_CLASS \
OF_CONSUMED \
|
︙ | | |
Modified src/OFApplication.h
from [879ac4c6e1]
to [b8b3df6515].
︙ | | |
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
+
-
-
-
-
+
+
+
+
+
|
* LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
* file.
*/
#import "OFObject.h"
@class OFString;
#ifndef DOXYGEN
@class OFArray;
@class OFDictionary;
@class OFMutableArray;
@class OFMutableDictionary;
@class OFArray OF_GENERIC(ObjectType);
@class OFDictionary OF_GENERIC(KeyType, ObjectType);
@class OFMutableArray OF_GENERIC(ObjectType);
@class OFMutableDictionary OF_GENERIC(KeyType, ObjectType);
#endif
#define OF_APPLICATION_DELEGATE(cls) \
int \
main(int argc, char *argv[]) \
{ \
return of_application_main(&argc, &argv, [cls class]); \
}
|
︙ | | |
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
|
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
|
-
-
+
+
-
-
+
+
+
|
* `OF_APPLICATION_DELEGATE(NameOfYourClass)` in the .m file of that class. The
* only required method of the @ref OFApplicationDelegate protocol is
* @ref OFApplicationDelegate::applicationDidFinishLaunching.
*/
@interface OFApplication: OFObject
{
OFString *_programName;
OFArray *_arguments;
OFDictionary *_environment;
OFArray OF_GENERIC(OFString*) *_arguments;
OFDictionary OF_GENERIC(OFString*, OFString*) *_environment;
int *_argc;
char ***_argv;
@public
id <OFApplicationDelegate> _delegate;
void (*_SIGINTHandler)(id, SEL);
#ifndef _WIN32
void (*_SIGHUPHandler)(id, SEL);
void (*_SIGUSR1Handler)(id, SEL);
void (*_SIGUSR2Handler)(id, SEL);
#endif
}
#ifdef OF_HAVE_PROPERTIES
@property (readonly, copy, nonatomic) OFString *programName;
@property (readonly, copy, nonatomic) OFArray *arguments;
@property (readonly, copy, nonatomic) OFDictionary *environment;
@property (readonly, copy, nonatomic) OFArray OF_GENERIC(OFString*) *arguments;
@property (readonly, copy, nonatomic)
OFDictionary OF_GENERIC(OFString*, OFString*) *environment;
@property (assign) id <OFApplicationDelegate> delegate;
#endif
/*!
* @brief Returns the only OFApplication instance in the application.
*
* @return The only OFApplication instance in the application
|
︙ | | |
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
|
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
|
-
+
-
+
|
+ (OFString*)programName;
/*!
* @brief Returns the arguments passed to the application.
*
* @return The arguments passed to the application
*/
+ (OFArray*)arguments;
+ (OFArray OF_GENERIC(OFString*)*)arguments;
/*!
* @brief Returns the environment of the application.
*
* @return The environment of the application
*/
+ (OFDictionary*)environment;
+ (OFDictionary OF_GENERIC(OFString*, OFString*)*)environment;
/*!
* @brief Terminates the application with the EXIT_SUCCESS status.
*/
+ (void)terminate OF_NO_RETURN;
/*!
|
︙ | | |
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
|
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
|
-
+
-
+
|
- (OFString*)programName;
/*!
* @brief Returns the arguments passed to the application.
*
* @return The arguments passed to the application
*/
- (OFArray*)arguments;
- (OFArray OF_GENERIC(OFString*)*)arguments;
/*!
* @brief Returns the environment of the application.
*
* @return The environment of the application
*/
- (OFDictionary*)environment;
- (OFDictionary OF_GENERIC(OFString*, OFString*)*)environment;
/*!
* @brief Returns the delegate of the application.
*
* @return The delegate of the application
*/
- (id <OFApplicationDelegate>)delegate;
|
︙ | | |
Modified src/OFArray.h
from [f79a9865e1]
to [3b343ee011].
︙ | | |
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
|
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
|
+
+
+
+
+
+
+
+
-
-
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
+
+
-
+
-
+
-
+
-
+
+
+
+
+
+
+
+
+
+
-
+
-
+
-
+
-
+
-
+
|
#endif
/*!
* @class OFArray OFArray.h ObjFW/OFArray.h
*
* @brief An abstract class for storing objects in an array.
*/
#ifdef OF_HAVE_GENERICS
@interface OFArray <ObjectType>:
#else
# ifndef DOXYGEN
# define ObjectType id
# endif
@interface OFArray:
#endif
@interface OFArray: OFObject <OFCopying, OFMutableCopying, OFCollection,
OFSerialization, OFJSONRepresentation, OFMessagePackRepresentation>
OFObject <OFCopying, OFMutableCopying, OFCollection, OFSerialization,
OFJSONRepresentation, OFMessagePackRepresentation>
#ifdef OF_HAVE_PROPERTIES
@property (readonly) size_t count;
#endif
/*!
* @brief Creates a new OFArray.
*
* @return A new autoreleased OFArray
*/
+ (instancetype)array;
/*!
* @brief Creates a new OFArray with the specified object.
*
* @param object An object
* @return A new autoreleased OFArray
*/
+ (instancetype)arrayWithObject: (id)object;
+ (instancetype)arrayWithObject: (ObjectType)object;
/*!
* @brief Creates a new OFArray with the specified objects, terminated by nil.
*
* @param firstObject The first object in the array
* @return A new autoreleased OFArray
*/
+ (instancetype)arrayWithObjects: (id)firstObject, ... OF_SENTINEL;
+ (instancetype)arrayWithObjects: (ObjectType)firstObject, ... OF_SENTINEL;
/*!
* @brief Creates a new OFArray with the objects from the specified array.
*
* @param array An array
* @return A new autoreleased OFArray
*/
+ (instancetype)arrayWithArray: (OFArray*)array;
+ (instancetype)arrayWithArray: (OFArray OF_GENERIC(ObjectType)*)array;
/*!
* @brief Creates a new OFArray with the objects from the specified C array of
* the specified length.
*
* @param objects A C array of objects
* @param count The length of the C array
* @return A new autoreleased OFArray
*/
+ (instancetype)arrayWithObjects: (id const*)objects
+ (instancetype)arrayWithObjects: (ObjectType const*)objects
count: (size_t)count;
/*!
* @brief Initializes an OFArray with the specified object.
*
* @param object An object
* @return An initialized OFArray
*/
- initWithObject: (id)object;
- initWithObject: (ObjectType)object;
/*!
* @brief Initializes an OFArray with the specified objects.
*
* @param firstObject The first object
* @return An initialized OFArray
*/
- initWithObjects: (id)firstObject, ... OF_SENTINEL;
- initWithObjects: (ObjectType)firstObject, ... OF_SENTINEL;
/*!
* @brief Initializes an OFArray with the specified object and a va_list.
*
* @param firstObject The first object
* @param arguments A va_list
* @return An initialized OFArray
*/
- initWithObject: (id)firstObject
- initWithObject: (ObjectType)firstObject
arguments: (va_list)arguments;
/*!
* @brief Initializes an OFArray with the objects from the specified array.
*
* @param array An array
* @return An initialized OFArray
*/
- initWithArray: (OFArray*)array;
- initWithArray: (OFArray OF_GENERIC(ObjectType)*)array;
/*!
* @brief Initializes an OFArray with the objects from the specified C array of
* the specified length.
*
* @param objects A C array of objects
* @param count The length of the C array
* @return An initialized OFArray
*/
- initWithObjects: (id const*)objects
- initWithObjects: (ObjectType const*)objects
count: (size_t)count;
/*!
* @brief Returns the object at the specified index in the array.
*
* @warning The returned object is *not* retained and autoreleased for
* performance reasons!
*
* @param index The index of the object to return
* @return The object at the specified index in the array
*/
- (id)objectAtIndex: (size_t)index;
- (id)objectAtIndexedSubscript: (size_t)index;
- (ObjectType)objectAtIndex: (size_t)index;
- (ObjectType)objectAtIndexedSubscript: (size_t)index;
/*!
* @brief Copies the objects at the specified range to the specified buffer.
*
* @param buffer The buffer to copy the objects to
* @param range The range to copy
*/
- (void)getObjects: (__unsafe_unretained id*)buffer
- (void)getObjects: (__unsafe_unretained ObjectType*)buffer
inRange: (of_range_t)range;
/*!
* @brief Returns the objects of the array as a C array.
*
* @return The objects of the array as a C array
*/
- (id const*)objects;
- (ObjectType const*)objects;
/*!
* @brief Returns the index of the first object that is equivalent to the
* specified object or `OF_NOT_FOUND` if it was not found.
*
* @param object The object whose index is returned
* @return The index of the first object equivalent to the specified object
* or `OF_NOT_FOUND` if it was not found
*/
- (size_t)indexOfObject: (id)object;
- (size_t)indexOfObject: (ObjectType)object;
/*!
* @brief Returns the index of the first object that has the same address as the
* specified object or `OF_NOT_FOUND` if it was not found.
*
* @param object The object whose index is returned
* @return The index of the first object that has the same aaddress as
* the specified object or `OF_NOT_FOUND` if it was not found
*/
- (size_t)indexOfObjectIdenticalTo: (id)object;
- (size_t)indexOfObjectIdenticalTo: (ObjectType)object;
/*!
* @brief Checks whether the array contains an object equal to the specified
* object.
*
* @param object The object which is checked for being in the array
* @return A boolean whether the array contains the specified object
*/
- (bool)containsObject: (ObjectType)object;
/*!
* @brief Checks whether the array contains an object with the specified
* address.
*
* @param object The object which is checked for being in the array
* @return A boolean whether the array contains an object with the specified
* address.
* address
*/
- (bool)containsObjectIdenticalTo: (id)object;
- (bool)containsObjectIdenticalTo: (ObjectType)object;
/*!
* @brief Returns the first object of the array or nil.
*
* @warning The returned object is *not* retained and autoreleased for
* performance reasons!
*
* @return The first object of the array or nil
*/
- (id)firstObject;
- (ObjectType)firstObject;
/*!
* @brief Returns the last object of the array or nil.
*
* @warning The returned object is *not* retained and autoreleased for
* performance reasons!
*
* @return The last object of the array or nil
*/
- (id)lastObject;
- (ObjectType)lastObject;
/*!
* @brief Returns the objects in the specified range as a new OFArray.
*
* @param range The range for the subarray
* @return The subarray as a new autoreleased OFArray
*/
- (OFArray*)objectsInRange: (of_range_t)range;
- (OFArray OF_GENERIC(ObjectType)*)objectsInRange: (of_range_t)range;
/*!
* @brief Creates a string by joining all objects of the array.
*
* @param separator The string with which the objects should be joined
* @return A string containing all objects joined by the separator
*/
|
︙ | | |
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
|
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
|
-
+
-
+
-
+
-
+
-
+
+
-
+
+
+
+
+
+
+
+
+
|
withObject: (id)object;
/*!
* @brief Returns a sorted copy of the array.
*
* @return A sorted copy of the array
*/
- (OFArray*)sortedArray;
- (OFArray OF_GENERIC(ObjectType)*)sortedArray;
/*!
* @brief Returns a sorted copy of the array.
*
* @param options The options to use when sorting the array.@n
* Possible values are:
* Value | Description
* ---------------------------|-------------------------
* `OF_ARRAY_SORT_DESCENDING` | Sort in descending order
* @return A sorted copy of the array
*/
- (OFArray*)sortedArrayWithOptions: (int)options;
- (OFArray OF_GENERIC(ObjectType)*)sortedArrayWithOptions: (int)options;
/*!
* @brief Returns a copy of the array with the order reversed.
*
* @return A copy of the array with the order reversed
*/
- (OFArray*)reversedArray;
- (OFArray OF_GENERIC(ObjectType)*)reversedArray;
/*!
* @brief Creates a new array with the specified object added.
*
* @param object The object to add
* @return A new array with the specified object added
*/
- (OFArray*)arrayByAddingObject: (id)object;
- (OFArray OF_GENERIC(ObjectType)*)arrayByAddingObject: (ObjectType)object;
/*!
* @brief Creates a new array with the objects from the specified array added.
*
* @param array The array with objects to add
* @return A new array with the objects from the specified array added
*/
- (OFArray*)arrayByAddingObjectsFromArray: (OFArray*)array;
- (OFArray OF_GENERIC(ObjectType)*)arrayByAddingObjectsFromArray:
(OFArray OF_GENERIC(ObjectType)*)array;
/*!
* @brief Creates a new array with the specified object removed.
*
* @param object The object to remove
* @return A new array with the specified object removed
*/
- (OFArray*)arrayByRemovingObject: (id)object;
- (OFArray OF_GENERIC(ObjectType)*)arrayByRemovingObject: (ObjectType)object;
/*!
* @brief Returns an OFEnumerator to enumerate through all objects of the
* array.
*
* @returns An OFEnumerator to enumerate through all objects of the array
*/
- (OFEnumerator OF_GENERIC(ObjectType)*)objectEnumerator;
#ifdef OF_HAVE_BLOCKS
/*!
* @brief Executes a block for each object.
*
* @param block The block to execute for each object
*/
|
︙ | | |
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
|
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
|
+
-
+
+
+
+
|
* @brief Creates a new array, only containing the objects for which the block
* returns true.
*
* @param block A block which determines if the object should be in the new
* array
* @return A new, autoreleased OFArray
*/
- (OFArray OF_GENERIC(ObjectType)*)filteredArrayUsingBlock:
- (OFArray*)filteredArrayUsingBlock: (of_array_filter_block_t)block;
(of_array_filter_block_t)block;
/*!
* @brief Folds the array to a single object using the specified block.
*
* If the array is empty, it will return nil.
*
* If there is only one object in the array, that object will be returned and
* the block will not be invoked.
*
* If there are at least two objects, the block is invoked for each object
* except the first, where left is always to what the array has already been
* folded and right what should be added to left.
*
* @param block A block which folds two objects into one, which is called for
* all objects except the first
* @return The array folded to a single object
*/
- (id)foldUsingBlock: (of_array_fold_block_t)block;
#endif
@end
#if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN)
# undef ObjectType
#endif
@interface OFArrayEnumerator: OFEnumerator
{
OFArray *_array;
size_t _count;
unsigned long _mutations;
unsigned long *_mutationsPtr;
|
︙ | | |
Modified src/OFCountedSet.h
from [f9b8bfd1b2]
to [0b0a8e2d9d].
︙ | | |
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
+
+
+
+
+
+
+
-
+
+
+
+
|
/*!
* @class OFCountedSet OFCountedSet.h ObjFW/OFCountedSet.h
*
* @brief An abstract class for a mutable unordered set of objects, counting how
* often it contains an object.
*/
#ifdef OF_HAVE_GENERICS
@interface OFCountedSet <ObjectType>: OFMutableSet <ObjectType>
#else
# ifndef DOXYGEN
# define ObjectType id
# endif
@interface OFCountedSet: OFMutableSet
#endif
/*!
* @brief Returns how often the object is in the set.
*
* @return How often the object is in the set
*/
- (size_t)countForObject: (id)object;
- (size_t)countForObject: (ObjectType)object;
#ifdef OF_HAVE_BLOCKS
/*!
* @brief Executes a block for each object in the set.
*
* @param block The block to execute for each object in the set
*/
- (void)enumerateObjectsAndCountUsingBlock:
(of_counted_set_enumeration_block_t)block;
#endif
@end
#if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN)
# undef ObjectType
#endif
|
Modified src/OFDictionary.h
from [de20ae16c5]
to [357ef085a2].
︙ | | |
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
|
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
|
-
+
+
+
+
+
+
+
+
-
-
+
+
+
+
-
+
+
-
-
+
+
-
-
+
+
+
-
-
+
+
-
+
+
-
+
-
-
+
+
-
-
+
+
-
-
+
+
-
+
-
+
-
-
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
-
+
-
+
-
+
+
+
+
+
+
+
+
+
-
+
-
+
+
+
+
+
|
#import "OFObject.h"
#import "OFCollection.h"
#import "OFEnumerator.h"
#import "OFSerialization.h"
#import "OFJSONRepresentation.h"
#import "OFMessagePackRepresentation.h"
@class OFArray;
@class OFArray OF_GENERIC(ObjectType);
#ifdef OF_HAVE_BLOCKS
typedef void (^of_dictionary_enumeration_block_t)(id key, id object,
bool *stop);
typedef bool (^of_dictionary_filter_block_t)(id key, id object);
typedef id (^of_dictionary_map_block_t)(id key, id object);
#endif
/*!
* @class OFDictionary OFDictionary.h ObjFW/OFDictionary.h
*
* @brief An abstract class for storing objects in a dictionary.
*
* Keys are copied and thus must conform to the OFCopying protocol.
*
* @note Fast enumeration on a dictionary enumerates through the keys of the
* dictionary.
*/
#ifdef OF_HAVE_GENERICS
@interface OFDictionary <KeyType, ObjectType>:
#else
# ifndef DOXYGEN
# define KeyType id
# define ObjectType id
# endif
@interface OFDictionary: OFObject <OFCopying, OFMutableCopying, OFCollection,
OFSerialization, OFJSONRepresentation, OFMessagePackRepresentation>
@interface OFDictionary:
#endif
OFObject <OFCopying, OFMutableCopying, OFCollection, OFSerialization,
OFJSONRepresentation, OFMessagePackRepresentation>
/*!
* @brief Creates a new OFDictionary.
*
* @return A new autoreleased OFDictionary
*/
+ (instancetype)dictionary;
/*!
* @brief Creates a new OFDictionary with the specified dictionary.
*
* @param dictionary An OFDictionary
* @return A new autoreleased OFDictionary
*/
+ (instancetype)dictionaryWithDictionary: (OFDictionary*)dictionary;
+ (instancetype)dictionaryWithDictionary:
(OFDictionary OF_GENERIC(KeyType, ObjectType)*)dictionary;
/*!
* @brief Creates a new OFDictionary with the specified key and object.
*
* @param key The key
* @param object The object
* @return A new autoreleased OFDictionary
*/
+ (instancetype)dictionaryWithObject: (id)object
forKey: (id)key;
+ (instancetype)dictionaryWithObject: (ObjectType)object
forKey: (KeyType)key;
/*!
* @brief Creates a new OFDictionary with the specified keys and objects.
*
* @param keys An array of keys
* @param objects An array of objects
* @return A new autoreleased OFDictionary
*/
+ (instancetype)dictionaryWithObjects: (OFArray*)objects
forKeys: (OFArray*)keys;
+ (instancetype)
dictionaryWithObjects: (OFArray OF_GENERIC(ObjectType)*)objects
forKeys: (OFArray OF_GENERIC(KeyType)*)keys;
/*!
* @brief Creates a new OFDictionary with the specified keys and objects.
*
* @param keys An array of keys
* @param objects An array of objects
* @param count The number of objects in the arrays
* @return A new autoreleased OFDictionary
*/
+ (instancetype)dictionaryWithObjects: (id const*)objects
forKeys: (id const*)keys
+ (instancetype)dictionaryWithObjects: (ObjectType const*)objects
forKeys: (KeyType const*)keys
count: (size_t)count;
/*!
* @brief Creates a new OFDictionary with the specified keys objects.
*
* @param firstKey The first key
* @return A new autoreleased OFDictionary
*/
+ (instancetype)dictionaryWithKeysAndObjects: (id)firstKey, ... OF_SENTINEL;
+ (instancetype)dictionaryWithKeysAndObjects: (KeyType)firstKey, ...
OF_SENTINEL;
/*!
* @brief Initializes an already allocated OFDictionary with the specified
* OFDictionary.
*
* @param dictionary An OFDictionary
* @return An initialized OFDictionary
*/
- initWithDictionary: (OFDictionary*)dictionary;
- initWithDictionary: (OFDictionary OF_GENERIC(KeyType, ObjectType)*)dictionary;
/*!
* @brief Initializes an already allocated OFDictionary with the specified key
* and object.
*
* @param key The key
* @param object The object
* @return An initialized OFDictionary
*/
- initWithObject: (id)object
forKey: (id)key;
- initWithObject: (ObjectType)object
forKey: (KeyType)key;
/*!
* @brief Initializes an already allocated OFDictionary with the specified keys
* and objects.
*
* @param keys An array of keys
* @param objects An array of objects
* @return An initialized OFDictionary
*/
- initWithObjects: (OFArray*)objects
forKeys: (OFArray*)keys;
- initWithObjects: (OFArray OF_GENERIC(ObjectType)*)objects
forKeys: (OFArray OF_GENERIC(KeyType)*)keys;
/*!
* @brief Initializes an already allocated OFDictionary with the specified keys
* and objects.
*
* @param keys An array of keys
* @param objects An array of objects
* @param count The number of objects in the arrays
* @return An initialized OFDictionary
*/
- initWithObjects: (id const*)objects
forKeys: (id const*)keys
- initWithObjects: (ObjectType const*)objects
forKeys: (KeyType const*)keys
count: (size_t)count;
/*!
* @brief Initializes an already allocated OFDictionary with the specified keys
* and objects.
*
* @param firstKey The first key
* @return An initialized OFDictionary
*/
- initWithKeysAndObjects: (id)firstKey, ... OF_SENTINEL;
- initWithKeysAndObjects: (KeyType)firstKey, ... OF_SENTINEL;
/*!
* @brief Initializes an already allocated OFDictionary with the specified key
* and va_list.
*
* @param firstKey The first key
* @param arguments A va_list of the other arguments
* @return An initialized OFDictionary
*/
- initWithKey: (id)firstKey
- initWithKey: (KeyType)firstKey
arguments: (va_list)arguments;
/*!
* @brief Returns the object for the given key or nil if the key was not found.
*
* @warning The returned object is *not* retained and autoreleased for
* performance reasons!
*
* @param key The key whose object should be returned
* @return The object for the given key or nil if the key was not found
*/
- (id)objectForKey: (id)key;
- (id)objectForKeyedSubscript: (id)key;
- (ObjectType)objectForKey: (KeyType)key;
- (ObjectType)objectForKeyedSubscript: (KeyType)key;
/*!
* @brief Checks whether the dictionary contains an object equal to the
* specified object.
*
* @param object The object which is checked for being in the dictionary
* @return A boolean whether the dictionary contains the specified object
*/
- (bool)containsObject: (ObjectType)object;
/*!
* @brief Checks whether the dictionary contains an object with the specified
* address.
*
* @param object The object which is checked for being in the dictionary
* @return A boolean whether the dictionary contains an object with the
* specified address.
* specified address
*/
- (bool)containsObjectIdenticalTo: (id)object;
- (bool)containsObjectIdenticalTo: (ObjectType)object;
/*!
* @brief Returns an array of all keys.
*
* @return An array of all keys
*/
- (OFArray*)allKeys;
- (OFArray OF_GENERIC(KeyType)*)allKeys;
/*!
* @brief Returns an array of all objects.
*
* @return An array of all objects
*/
- (OFArray*)allObjects;
- (OFArray OF_GENERIC(ObjectType)*)allObjects;
/*!
* @brief Returns an OFEnumerator to enumerate through the dictionary's keys.
*
* @return An OFEnumerator to enumerate through the dictionary's keys
*/
- (OFEnumerator*)keyEnumerator;
- (OFEnumerator OF_GENERIC(KeyType)*)keyEnumerator;
/*!
* @brief Returns an OFEnumerator to enumerate through the dictionary's objects.
*
* @return An OFEnumerator to enumerate through the dictionary's objects
*/
- (OFEnumerator OF_GENERIC(ObjectType)*)objectEnumerator;
#ifdef OF_HAVE_BLOCKS
/*!
* @brief Executes a block for each key / object pair.
*
* @param block The block to execute for each key / object pair.
*/
- (void)enumerateKeysAndObjectsUsingBlock:
(of_dictionary_enumeration_block_t)block;
/*!
* @brief Creates a new dictionary, mapping each object using the specified
* block.
*
* @param block A block which maps an object for each object
* @return A new autoreleased OFDictionary
*/
- (OFDictionary OF_GENERIC(KeyType, id)*)mappedDictionaryUsingBlock:
- (OFDictionary*)mappedDictionaryUsingBlock: (of_dictionary_map_block_t)block;
(of_dictionary_map_block_t)block;
/*!
* @brief Creates a new dictionary, only containing the objects for which the
* block returns true.
*
* @param block A block which determines if the object should be in the new
* dictionary
* @return A new autoreleased OFDictionary
*/
- (OFDictionary*)filteredDictionaryUsingBlock:
- (OFDictionary OF_GENERIC(KeyType, ObjectType)*)filteredDictionaryUsingBlock:
(of_dictionary_filter_block_t)block;
#endif
@end
#if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN)
# undef KeyType
# undef ObjectType
#endif
#import "OFMutableDictionary.h"
#ifndef NSINTEGER_DEFINED
/* Required for dictionary literals to work */
@compatibility_alias NSDictionary OFDictionary;
#endif
|
Modified src/OFDictionary.m
from [58aa170985]
to [fae9385bda].
︙ | | |
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
|
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
|
-
+
-
+
|
[ret makeImmutable];
objc_autoreleasePoolPop(pool);
return ret;
}
- (OFEnumerator*)objectEnumerator
- (OFEnumerator*)keyEnumerator
{
OF_UNRECOGNIZED_SELECTOR
}
- (OFEnumerator*)keyEnumerator
- (OFEnumerator*)objectEnumerator
{
OF_UNRECOGNIZED_SELECTOR
}
- (int)countByEnumeratingWithState: (of_fast_enumeration_state_t*)state
objects: (id*)objects
count: (int)count_
|
︙ | | |
Modified src/OFEnumerator.h
from [04188c1de5]
to [289c822ada].
︙ | | |
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
+
-
-
+
+
+
|
* Public License, either version 2 or 3, which can be found in the file
* LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
* file.
*/
#import "OFObject.h"
#ifndef DOXYGEN
@class OFEnumerator;
@class OFArray;
@class OFEnumerator OF_GENERIC(ObjectType);
@class OFArray OF_GENERIC(ObjectType);
#endif
/*!
* @protocol OFEnumerating OFEnumerator.h ObjFW/OFEnumerator.h
*
* @brief A protocol for getting an enumerator for the object.
*/
@protocol OFEnumerating
|
︙ | | |
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
|
+
+
+
+
+
+
+
-
+
-
+
+
+
+
|
@end
/*!
* @class OFEnumerator OFEnumerator.h ObjFW/OFEnumerator.h
*
* @brief A class which provides methods to enumerate through collections.
*/
#ifdef OF_HAVE_GENERICS
@interface OFEnumerator <ObjectType>: OFObject
#else
# ifndef DOXYGEN
# define ObjectType id
# endif
@interface OFEnumerator: OFObject
#endif
/*!
* @brief Returns the next object.
*
* @return The next object
*/
- (id)nextObject;
- (ObjectType)nextObject;
/*!
* @brief Returns an array of all remaining objects in the collection.
*
* @return An array of all remaining objects in the collection
*/
- (OFArray*)allObjects;
- (OFArray OF_GENERIC(ObjectType)*)allObjects;
/*!
* @brief Resets the enumerator, so the next call to nextObject returns the
* first object again.
*/
- (void)reset;
@end
#if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN)
# undef ObjectType
#endif
/*
* This needs to be exactly like this because it's hardcoded in the compiler.
*
* We need this bad check to see if we already imported Cocoa, which defines
* this as well.
*/
|
︙ | | |
Modified src/OFFile.h
from [7f83bdcf57]
to [ebd8f096a0].
︙ | | |
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
-
+
|
#endif
#include <sys/types.h>
#include <sys/stat.h>
#import "OFSeekableStream.h"
@class OFArray;
@class OFArray OF_GENERIC(ObjectType);
@class OFDate;
#if defined(_WIN32)
typedef struct __stat64 of_stat_t;
#elif defined(OF_HAVE_OFF64_T)
typedef struct stat64 of_stat_t;
#else
|
︙ | | |
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
|
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
|
-
+
|
* @brief Returns an array with the items in the specified directory.
*
* @note `.` and `..` are not part of the returned array.
*
* @param path The path to the directory whose items should be returned
* @return An array of OFStrings with the items in the specified directory
*/
+ (OFArray*)contentsOfDirectoryAtPath: (OFString*)path;
+ (OFArray OF_GENERIC(OFString*)*)contentsOfDirectoryAtPath: (OFString*)path;
/*!
* @brief Changes the current working directory.
*
* @param path The new directory to change to
*/
+ (void)changeCurrentDirectoryPath: (OFString*)path;
|
︙ | | |
Modified src/OFHTTPClient.h
from [aa446e953e]
to [65cccf1fb8].
︙ | | |
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
-
+
|
#endif
@class OFHTTPClient;
@class OFHTTPRequest;
@class OFHTTPResponse;
@class OFURL;
@class OFTCPSocket;
@class OFDictionary;
@class OFDictionary OF_GENERIC(KeyType, ObjectType);
@class OFDataArray;
/*!
* @protocol OFHTTPClientDelegate OFHTTPClient.h ObjFW/OFHTTPClient.h
*
* @brief A delegate for OFHTTPClient.
*/
|
︙ | | |
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
-
+
|
* @param client The OFHTTPClient which received the headers
* @param headers The headers received
* @param statusCode The status code received
* @param request The request for which the headers and status code have been
* received
*/
- (void)client: (OFHTTPClient*)client
didReceiveHeaders: (OFDictionary*)headers
didReceiveHeaders: (OFDictionary OF_GENERIC(OFString*, OFString*)*)headers
statusCode: (int)statusCode
request: (OFHTTPRequest*)request;
/*!
* @brief A callback which is called when an OFHTTPClient wants to follow a
* redirect.
*
|
︙ | | |
Modified src/OFHTTPRequest.h
from [2ca5d029e3]
to [22005b677b].
︙ | | |
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
-
+
|
#import "OFString.h"
#ifndef OF_HAVE_SOCKETS
# error No sockets available!
#endif
@class OFURL;
@class OFDictionary;
@class OFDictionary OF_GENERIC(KeyType, ObjectType);
@class OFDataArray;
@class OFString;
/*! @file */
/*!
* @brief The type of an HTTP request.
|
︙ | | |
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
|
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
|
-
+
-
+
|
* @brief A class for storing HTTP requests.
*/
@interface OFHTTPRequest: OFObject <OFCopying>
{
OFURL *_URL;
of_http_request_method_t _method;
of_http_request_protocol_version_t _protocolVersion;
OFDictionary *_headers;
OFDictionary OF_GENERIC(OFString*, OFString*) *_headers;
OFDataArray *_body;
OFString *_remoteAddress;
}
#ifdef OF_HAVE_PROPERTIES
@property (copy) OFURL *URL;
@property of_http_request_method_t method;
@property of_http_request_protocol_version_t protocolVersion;
@property (copy) OFDictionary *headers;
@property (copy) OFDictionary OF_GENERIC(OFString*, OFString*) *headers;
@property (retain) OFDataArray *body;
@property (copy) OFString *remoteAddress;
#endif
/*!
* @brief Creates a new OFHTTPRequest.
*
|
︙ | | |
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
|
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
|
-
+
-
+
|
- (OFString*)protocolVersionString;
/*!
* @brief Sets a dictionary with headers for the HTTP request.
*
* @param headers A dictionary with headers for the HTTP request
*/
- (void)setHeaders: (OFDictionary*)headers;
- (void)setHeaders: (OFDictionary OF_GENERIC(OFString*, OFString*)*)headers;
/*!
* @brief Returns a dictionary with headers for the HTTP request.
*
* @return A dictionary with headers for the HTTP request.
*/
- (OFDictionary*)headers;
- (OFDictionary OF_GENERIC(OFString*, OFString*)*)headers;
/*!
* @brief Sets the entity body of the HTTP request.
*
* @param body The entity body of the HTTP request
*/
- (void)setBody: (OFDataArray*)body;
|
︙ | | |
Modified src/OFHTTPResponse.h
from [c20c817486]
to [988402eb89].
︙ | | |
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
-
+
-
+
-
+
|
* LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
* file.
*/
#import "OFStream.h"
#import "OFHTTPRequest.h"
@class OFDictionary;
@class OFDictionary OF_GENERIC(KeyType, ObjectType);
/*!
* @class OFHTTPResponse OFHTTPResponse.h ObjFW/OFHTTPResponse.h
*
* @brief A class for representing an HTTP request reply as a stream.
*/
@interface OFHTTPResponse: OFStream
{
of_http_request_protocol_version_t _protocolVersion;
short _statusCode;
OFDictionary *_headers;
OFDictionary OF_GENERIC(OFString*, OFString*) *_headers;
}
#ifdef OF_HAVE_PROPERTIES
@property of_http_request_protocol_version_t protocolVersion;
@property short statusCode;
@property (copy) OFDictionary *headers;
@property (copy) OFDictionary OF_GENERIC(OFString*, OFString*) *headers;
#endif
/*!
* @brief Sets the protocol version of the HTTP request reply.
*
* @param protocolVersion The protocol version of the HTTP request reply
*/
|
︙ | | |
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
|
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
|
-
+
-
+
|
- (void)setStatusCode: (short)statusCode;
/*!
* @brief Returns the headers of the reply to the HTTP request.
*
* @return The headers of the reply to the HTTP request
*/
- (OFDictionary*)headers;
- (OFDictionary OF_GENERIC(OFString*, OFString*)*)headers;
/*!
* @brief Returns the headers of the reply to the HTTP request.
*
* @param headers The headers of the reply to the HTTP request
*/
- (void)setHeaders: (OFDictionary*)headers;
- (void)setHeaders: (OFDictionary OF_GENERIC(OFString*, OFString*)*)headers;
/*!
* @brief Returns the reply as a string, trying to detect the encoding.
*
* @return The reply as a string
*/
- (OFString*)string;
|
︙ | | |
Modified src/OFINICategory.h
from [f170a65249]
to [96f0151dae].
︙ | | |
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
+
-
-
+
+
+
|
* LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
* file.
*/
#import "OFObject.h"
@class OFString;
#ifndef DOXYGEN
@class OFArray;
@class OFMutableArray;
@class OFArray OF_GENERIC(ObjectType);
@class OFMutableArray OF_GENERIC(ObjectType);
#endif
/*!
* @class OFINICategory OFINICategory.h ObjFW/OFINICategory.h
*
* @brief A class for representing a category of an INI file.
*/
@interface OFINICategory: OFObject
|
︙ | | |
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
|
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
|
-
+
|
* A multi-key is a key which exists several times in the same category. Each
* occurrence of the key/value pair adds the respective value to the array.
*
* @param key The multi-key for which the array should be returned
* @return The array for the specified key, or an empty array if it does not
* exist
*/
- (OFArray*)arrayForKey: (OFString*)key;
- (OFArray OF_GENERIC(OFString*)*)arrayForKey: (OFString*)key;
/*!
* @brief Sets the value of the specified key to the specified string.
*
* If the specified key is a multi-key (see @ref arrayForKey:), the value of
* the first key/value pair found is changed.
*
|
︙ | | |
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
|
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
|
-
+
|
* yet, it is appended to the section.
*
* See also @ref arrayForKey: for more information about multi-keys.
*
* @param array The array of strings to which the multi-key should be set
* @param key The multi-key for which the new values should be set
*/
- (void)setArray: (OFArray*)array
- (void)setArray: (OFArray OF_GENERIC(OFString*)*)array
forKey: (OFString*)key;
/*!
* @brief Removes the value for the specified key
*
* If the specified key is a multi-key (see @ref arrayForKey:), all key/value
* pairs matching the specified key are removed.
*
* @param key The key of the value to remove
*/
- (void)removeValueForKey: (OFString*)key;
@end
|
Modified src/OFINIFile.h
from [98bc445d76]
to [2b02002d00].
︙ | | |
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
-
+
-
+
|
* file.
*/
#import "OFObject.h"
#import "OFString.h"
#import "OFINICategory.h"
@class OFMutableArray;
@class OFMutableArray OF_GENERIC(ObjectType);
/*!
* @class OFINIFile OFINIFile.h ObjFW/OFINIFile.h
*
* @brief A class for reading, creating and modifying INI files.
*/
@interface OFINIFile: OFObject
{
OFMutableArray *_categories;
OFMutableArray OF_GENERIC(OFINICategory*) *_categories;
}
/*!
* @brief Creates a new OFINIFile with the contents of the specified file.
*
* @param path The path to the file whose contents the OFINIFile should contain
*
|
︙ | | |
Modified src/OFIntrospection.h
from [133f93ff8b]
to [757a211040].
︙ | | |
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
+
-
-
+
+
+
|
* LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
* file.
*/
#import "OFObject.h"
@class OFString;
#ifndef DOXYGEN
@class OFArray;
@class OFMutableArray;
@class OFArray OF_GENERIC(ObjectType);
@class OFMutableArray OF_GENERIC(ObjectType);
#endif
enum {
OF_PROPERTY_READONLY = 0x01,
OF_PROPERTY_ASSIGN = 0x04,
OF_PROPERTY_READWRITE = 0x08,
OF_PROPERTY_RETAIN = 0x10,
OF_PROPERTY_COPY = 0x20,
|
︙ | | |
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
|
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
|
-
-
-
-
+
+
+
+
-
-
-
-
+
+
+
+
+
|
/*!
* @class OFIntrospection OFIntrospection.h ObjFW/OFIntrospection.h
*
* @brief A class for introspecting classes.
*/
@interface OFIntrospection: OFObject
{
OFMutableArray *_classMethods;
OFMutableArray *_instanceMethods;
OFMutableArray *_properties;
OFMutableArray *_instanceVariables;
OFMutableArray OF_GENERIC(OFMethod*) *_classMethods;
OFMutableArray OF_GENERIC(OFMethod*) *_instanceMethods;
OFMutableArray OF_GENERIC(OFProperty*) *_properties;
OFMutableArray OF_GENERIC(OFInstanceVariable*) *_instanceVariables;
}
#ifdef OF_HAVE_PROPERTIES
@property (readonly, copy) OFArray *classMethods;
@property (readonly, copy) OFArray *instanceMethods;
@property (readonly, copy) OFArray *properties;
@property (readonly, copy) OFArray *instanceVariables;
@property (readonly, copy) OFArray OF_GENERIC(OFMethod*) *classMethods;
@property (readonly, copy) OFArray OF_GENERIC(OFMethod*) *instanceMethods;
@property (readonly, copy) OFArray OF_GENERIC(OFProperty*) *properties;
@property (readonly, copy)
OFArray OF_GENERIC(OFInstanceVariable*) *instanceVariables;
#endif
/*!
* @brief Creates a new introspection for the specified class.
*
* @return A new, autoreleased introspection for the specified class
*/
|
︙ | | |
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
|
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
|
-
+
-
+
|
- initWithClass: (Class)class_;
/*!
* @brief Returns the class methods of the class.
*
* @return An array of objects of class @ref OFMethod
*/
- (OFArray*)classMethods;
- (OFArray OF_GENERIC(OFMethod*)*)classMethods;
/*!
* @brief Returns the instance methods of the class.
*
* @return An array of objects of class @ref OFMethod
*/
- (OFArray*)instanceMethods;
- (OFArray OF_GENERIC(OFMethod*)*)instanceMethods;
/*!
* @brief Returns the properties of the class.
*
* @warning **Do not rely on this, as this behaves differently depending on the
* compiler and ABI used!**
*
|
︙ | | |
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
|
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
|
-
+
-
+
|
* used.
*
* @warning GCC does not emit any data for property introspection for the GNU
* ABI.
*
* @return An array of objects of class @ref OFProperty
*/
- (OFArray*)properties;
- (OFArray OF_GENERIC(OFProperty*)*)properties;
/*!
* @brief Returns the instance variables of the class.
*
* @return An array of objects of class @ref OFInstanceVariable
*/
- (OFArray*)instanceVariables;
- (OFArray OF_GENERIC(OFInstanceVariable*)*)instanceVariables;
/* TODO: protocols */
@end
|
Modified src/OFKernelEventObserver.h
from [c48f1a2944]
to [5f1691d0b1].
︙ | | |
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
-
-
+
+
|
* file.
*/
#import "OFObject.h"
#import "socket.h"
@class OFMutableArray;
@class OFMutableDictionary;
@class OFMutableArray OF_GENERIC(ObjectType);
@class OFMutableDictionary OF_GENERIC(KeyType, ObjectType);
@class OFDataArray;
#ifdef OF_HAVE_THREADS
@class OFMutex;
#endif
@class OFDate;
/*!
|
︙ | | |
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
|
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
|
+
-
-
+
+
+
|
* @brief A class that can observe multiple kernel events (e.g. streams being
* ready to read) at once.
*
* @note Currently, Win32 can only observe TCP and UDP sockets!
*/
@interface OFKernelEventObserver: OFObject
{
OFMutableArray OF_GENERIC(id <OFReadyForReadingObserving>)
OFMutableArray *_readObjects;
OFMutableArray *_writeObjects;
*_readObjects;
OFMutableArray OF_GENERIC(id <OFReadyForWritingObserving>)
*_writeObjects;
OFMutableArray *_queue;
OFDataArray *_queueActions;
id <OFKernelEventObserverDelegate> _delegate;
#ifdef OF_HAVE_PIPE
int _cancelFD[2];
#else
of_socket_t _cancelFD[2];
|
︙ | | |
Modified src/OFKernelEventObserver_kqueue.h
from [697c4594b5]
to [59ced1df2f].
︙ | | |
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
-
+
|
* LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
* file.
*/
#import "OFKernelEventObserver.h"
@class OFDataArray;
@class OFMutableArray;
@class OFMutableArray OF_GENERIC(ObjectType);
@interface OFKernelEventObserver_kqueue: OFKernelEventObserver
{
int _kernelQueue;
OFDataArray *_changeList;
OFMutableArray *_removedArray;
}
|
︙ | | |
Modified src/OFList.h
from [f98a3d7c30]
to [41ad30e5c0].
︙ | | |
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
+
+
+
+
+
+
+
+
-
+
|
};
/*!
* @class OFList OFList.h ObjFW/OFList.h
*
* @brief A class which provides easy to use double-linked lists.
*/
#ifdef OF_HAVE_GENERICS
@interface OFList <ObjectType>:
#else
# ifndef DOXYGEN
# define ObjectType id
# endif
@interface OFList:
#endif
@interface OFList: OFObject <OFCopying, OFCollection, OFSerialization>
OFObject <OFCopying, OFCollection, OFSerialization>
{
of_list_object_t *_firstListObject;
of_list_object_t *_lastListObject;
size_t _count;
unsigned long _mutations;
}
|
︙ | | |
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
|
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
|
-
+
-
+
-
+
-
+
+
+
+
+
+
+
+
+
+
-
+
-
+
+
+
+
+
+
+
+
-
+
-
+
+
+
+
|
* @brief Appends an object to the list.
*
* @param object The object to append
* @return An of_list_object_t, needed to identify the object inside the list.
* For example, if you want to remove an object from the list, you need
* its of_list_object_t.
*/
- (of_list_object_t*)appendObject: (id)object;
- (of_list_object_t*)appendObject: (ObjectType)object;
/*!
* @brief Prepends an object to the list.
*
* @param object The object to prepend
* @return An of_list_object_t, needed to identify the object inside the list.
* For example, if you want to remove an object from the list, you need
* its of_list_object_t.
*/
- (of_list_object_t*)prependObject: (id)object;
- (of_list_object_t*)prependObject: (ObjectType)object;
/*!
* @brief Inserts an object before another list object.
*
* @param object The object to insert
* @param listObject The of_list_object_t of the object before which it should
* be inserted
* @return An of_list_object_t, needed to identify the object inside the list.
* For example, if you want to remove an object from the list, you need
* its of_list_object_t.
*/
- (of_list_object_t*)insertObject: (id)object
- (of_list_object_t*)insertObject: (ObjectType)object
beforeListObject: (of_list_object_t*)listObject;
/*!
* @brief Inserts an object after another list object.
*
* @param object The object to insert
* @param listObject The of_list_object_t of the object after which it should be
* inserted
* @return An of_list_object_t, needed to identify the object inside the list.
* For example, if you want to remove an object from the list, you need
* its of_list_object_t.
*/
- (of_list_object_t*)insertObject: (id)object
- (of_list_object_t*)insertObject: (ObjectType)object
afterListObject: (of_list_object_t*)listObject;
/*!
* @brief Removes the object with the specified list object from the list.
*
* @param listObject The list object returned by append / prepend
*/
- (void)removeListObject: (of_list_object_t*)listObject;
/*!
* @brief Checks whether the list contains an object equal to the specified
* object.
*
* @param object The object which is checked for being in the list
* @return A boolean whether the list contains the specified object
*/
- (bool)containsObject: (ObjectType)object;
/*!
* @brief Checks whether the list contains an object with the specified address.
*
* @param object The object which is checked for being in the list
* @return A boolean whether the list contains an object with the specified
* address.
* address
*/
- (bool)containsObjectIdenticalTo: (id)object;
- (bool)containsObjectIdenticalTo: (ObjectType)object;
/*!
* @brief Returns an OFEnumerator to enumerate through all objects of the list.
*
* @returns An OFEnumerator to enumerate through all objects of the list
*/
- (OFEnumerator OF_GENERIC(ObjectType)*)objectEnumerator;
/*!
* @brief Returns the first object of the list or nil.
*
* @warning The returned object is *not* retained and autoreleased for
* performance reasons!
*
* @return The first object of the list or nil
*/
- (id)firstObject;
- (ObjectType)firstObject;
/*!
* @brief Returns the last object of the list or nil.
*
* @warning The returned object is *not* retained and autoreleased for
* performance reasons!
*
* @return The last object of the list or nil
*/
- (id)lastObject;
- (ObjectType)lastObject;
/*!
* @brief Removes all objects from the list.
*/
- (void)removeAllObjects;
@end
#if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN)
# undef ObjectType
#endif
@interface OFListEnumerator: OFEnumerator
{
OFList *_list;
of_list_object_t *_current;
unsigned long _mutations;
unsigned long *_mutationsPtr;
}
- initWithList: (OFList*)list
mutationsPointer: (unsigned long*)mutationsPtr;
@end
|
Modified src/OFMutableArray.h
from [687d488ccc]
to [d606689457].
︙ | | |
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
+
+
+
+
+
+
+
|
/*!
* @class OFMutableArray OFArray.h ObjFW/OFArray.h
*
* @brief An abstract class for storing, adding and removing objects in an
* array.
*/
#ifdef OF_HAVE_GENERICS
@interface OFMutableArray <ObjectType>: OFArray <ObjectType>
#else
# ifndef DOXYGEN
# define ObjectType id
# endif
@interface OFMutableArray: OFArray
#endif
/*!
* @brief Creates a new OFMutableArray with enough memory to hold the specified
* number of objects.
*
* @param capacity The initial capacity for the OFMutableArray
* @return A new autoreleased OFMutableArray
*/
|
︙ | | |
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
|
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
|
-
+
-
+
-
+
-
+
-
-
+
+
-
-
+
+
-
-
+
+
-
+
-
+
|
- initWithCapacity: (size_t)capacity;
/*!
* @brief Adds an object to the end of the array.
*
* @param object An object to add
*/
- (void)addObject: (id)object;
- (void)addObject: (ObjectType)object;
/*!
* @brief Adds the objects from the specified OFArray to the end of the array.
*
* @param array An array of objects to add
*/
- (void)addObjectsFromArray: (OFArray*)array;
- (void)addObjectsFromArray: (OFArray OF_GENERIC(ObjectType)*)array;
/*!
* @brief Inserts an object to the OFArray at the specified index.
*
* @param object An object to add
* @param index The index where the object should be inserted
*/
- (void)insertObject: (id)object
- (void)insertObject: (ObjectType)object
atIndex: (size_t)index;
/*!
* @brief Inserts the objects from the specified OFArray at the specified index.
*
* @param array An array of objects
* @param index The index where the objects should be inserted
*/
- (void)insertObjectsFromArray: (OFArray*)array
- (void)insertObjectsFromArray: (OFArray OF_GENERIC(ObjectType)*)array
atIndex: (size_t)index;
/*!
* @brief Replaces the first object equivalent to the specified object with the
* other specified object.
*
* @param oldObject The object to replace
* @param newObject The replacement object
*/
- (void)replaceObject: (id)oldObject
withObject: (id)newObject;
- (void)replaceObject: (ObjectType)oldObject
withObject: (ObjectType)newObject;
/*!
* @brief Replaces the object at the specified index with the specified object.
*
* @param index The index of the object to replace
* @param object The replacement object
*/
- (void)replaceObjectAtIndex: (size_t)index
withObject: (id)object;
- (void)setObject: (id)object
withObject: (ObjectType)object;
- (void)setObject: (ObjectType)object
atIndexedSubscript: (size_t)index;
/*!
* @brief Replaces the first object that has the same address as the specified
* object with the other specified object.
*
* @param oldObject The object to replace
* @param newObject The replacement object
*/
- (void)replaceObjectIdenticalTo: (id)oldObject
withObject: (id)newObject;
- (void)replaceObjectIdenticalTo: (ObjectType)oldObject
withObject: (ObjectType)newObject;
/*!
* @brief Removes the first object equivalent to the specified object.
*
* @param object The object to remove
*/
- (void)removeObject: (id)object;
- (void)removeObject: (ObjectType)object;
/*!
* @brief Removes the first object that has the same address as the specified
* object.
*
* @param object The object to remove
*/
- (void)removeObjectIdenticalTo: (id)object;
- (void)removeObjectIdenticalTo: (ObjectType)object;
/*!
* @brief Removes the object at the specified index.
*
* @param index The index of the object to remove
*/
- (void)removeObjectAtIndex: (size_t)index;
|
︙ | | |
196
197
198
199
200
201
202
|
203
204
205
206
207
208
209
210
211
212
|
+
+
+
|
- (void)reverse;
/*!
* @brief Converts the mutable array to an immutable array.
*/
- (void)makeImmutable;
@end
#if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN)
# undef ObjectType
#endif
|
Modified src/OFMutableDictionary.h
from [76e424b890]
to [1bc847e58e].
︙ | | |
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
+
+
+
+
+
+
+
+
+
|
#endif
/*!
* @class OFMutableDictionary OFDictionary.h ObjFW/OFDictionary.h
*
* @brief An abstract class for storing and changing objects in a dictionary.
*/
#ifdef OF_HAVE_GENERICS
@interface OFMutableDictionary <KeyType, ObjectType>:
OFDictionary <KeyType, ObjectType>
#else
# ifndef DOXYGEN
# define KeyType id
# define ObjectType id
# endif
@interface OFMutableDictionary: OFDictionary
#endif
/*!
* @brief Creates a new OFMutableDictionary with enough memory to hold the
* specified number of objects.
*
* @param capacity The initial capacity for the OFMutableDictionary
* @return A new autoreleased OFMutableDictionary
*/
|
︙ | | |
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
|
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
|
-
-
-
-
+
+
+
+
-
+
+
+
+
+
|
* @brief Sets an object for a key.
*
* A key can be any object that conforms to the OFCopying protocol.
*
* @param key The key to set
* @param object The object to set the key to
*/
- (void)setObject: (id)object
forKey: (id)key;
- (void)setObject: (id)object
forKeyedSubscript: (id)key;
- (void)setObject: (ObjectType)object
forKey: (KeyType)key;
- (void)setObject: (ObjectType)object
forKeyedSubscript: (KeyType)key;
/*!
* @brief Removes the object for the specified key from the dictionary.
*
* @param key The key whose object should be removed
*/
- (void)removeObjectForKey: (id)key;
- (void)removeObjectForKey: (KeyType)key;
/*!
* @brief Removes all objects.
*/
- (void)removeAllObjects;
#ifdef OF_HAVE_BLOCKS
/*!
* @brief Replaces each object with the object returned by the block.
*
* @param block The block which returns a new object for each object
*/
- (void)replaceObjectsUsingBlock: (of_dictionary_replace_block_t)block;
#endif
/*!
* @brief Converts the mutable dictionary to an immutable dictionary.
*/
- (void)makeImmutable;
@end
#if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN)
# undef KeyType
# undef ObjectType
#endif
|
Modified src/OFMutableSet.h
from [acd04b2903]
to [4371ecc2d9].
︙ | | |
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
+
+
+
+
+
+
+
-
+
-
+
-
+
-
+
-
+
+
+
+
|
#import "OFSet.h"
/*!
* @class OFMutableSet OFSet.h ObjFW/OFSet.h
*
* @brief An abstract class for a mutable unordered set of unique objects.
*/
#ifdef OF_HAVE_GENERICS
@interface OFMutableSet <ObjectType>: OFSet <ObjectType>
#else
# ifndef DOXYGEN
# define ObjectType id
# endif
@interface OFMutableSet: OFSet
#endif
/*!
* @brief Adds the specified object to the set.
*
* @param object The object to add to the set
*/
- (void)addObject: (id)object;
- (void)addObject: (ObjectType)object;
/*!
* @brief Removes the specified object from the set.
*
* @param object The object to remove from the set
*/
- (void)removeObject: (id)object;
- (void)removeObject: (ObjectType)object;
/*!
* @brief Removes all objects from the receiver which are in the specified set.
*
* @param set The set whose objects will be removed from the receiver
*/
- (void)minusSet: (OFSet*)set;
- (void)minusSet: (OFSet OF_GENERIC(ObjectType)*)set;
/*!
* @brief Removes all objects from the receiver which are not in the specified
* set.
*
* @param set The set to intersect with
*/
- (void)intersectSet: (OFSet*)set;
- (void)intersectSet: (OFSet OF_GENERIC(ObjectType)*)set;
/*!
* @brief Creates a union of the receiver and the specified set.
*
* @param set The set to create the union with
*/
- (void)unionSet: (OFSet*)set;
- (void)unionSet: (OFSet OF_GENERIC(ObjectType)*)set;
/*!
* @brief Converts the mutable set to an immutable set.
*/
- (void)makeImmutable;
@end
#if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN)
# undef ObjectType
#endif
|
Modified src/OFOptionsParser.h
from [5b9af68f2d]
to [e68f8554d3].
︙ | | |
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
-
+
|
* @class OFOptionsParser OFOptionsParser.h ObjFW/OFOptionsParser.h
*
* @brief A class for parsing the program options specified on the command line.
*/
@interface OFOptionsParser: OFObject
{
of_unichar_t *_options;
OFArray *_arguments;
OFArray OF_GENERIC(OFString*) *_arguments;
size_t _index, _subIndex;
of_unichar_t _lastOption;
OFString *_argument;
bool _done;
}
/*!
|
︙ | | |
85
86
87
88
89
90
91
92
93
|
85
86
87
88
89
90
91
92
93
|
-
+
|
- (OFString*)argument;
/*!
* @brief Returns the arguments following the last option.
*
* @return The arguments following the last option
*/
- (OFArray*)remainingArguments;
- (OFArray OF_GENERIC(OFString*)*)remainingArguments;
@end
|
Modified src/OFProcess.h
from [053077896b]
to [d9cfbadee0].
︙ | | |
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
-
-
+
+
|
#import "OFStream.h"
#import "OFString.h"
#ifdef _WIN32
# include <windows.h>
#endif
@class OFArray;
@class OFDictionary;
@class OFArray OF_GENERIC(ObjectType);
@class OFDictionary OF_GENERIC(KeyType, ObjectType);
/*!
* @class OFProcess OFProcess.h ObjFW/OFProcess.h
*
* @brief A class for stream-like communication with a newly created process.
*/
@interface OFProcess: OFStream
|
︙ | | |
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
|
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
|
-
+
-
+
-
-
+
+
+
|
*
* @param program The program to execute. If it does not start with a slash, the
* search path specified in PATH is used.
* @param arguments The arguments to pass to the program, or nil
* @return A new, autoreleased OFProcess.
*/
+ (instancetype)processWithProgram: (OFString*)program
arguments: (OFArray*)arguments;
arguments: (OFArray OF_GENERIC(OFString*)*)arguments;
/*!
* @brief Creates a new OFProcess with the specified program, program name and
* arguments and invokes the program.
*
* @param program The program to execute. If it does not start with a slash, the
* search path specified in PATH is used.
* @param programName The program name for the program to invoke (argv[0]).
* Usually, this is equal to program.
* @param arguments The arguments to pass to the program, or nil
* @return A new, autoreleased OFProcess.
*/
+ (instancetype)processWithProgram: (OFString*)program
programName: (OFString*)programName
arguments: (OFArray*)arguments;
arguments: (OFArray OF_GENERIC(OFString*)*)arguments;
/*!
* @brief Creates a new OFProcess with the specified program, program name,
* arguments and environment and invokes the program.
*
* @param program The program to execute. If it does not start with a slash, the
* search path specified in PATH is used.
* @param programName The program name for the program to invoke (argv[0]).
* Usually, this is equal to program.
* @param arguments The arguments to pass to the program, or nil
* @param environment The environment to pass to the program, or nil. If it is
* non-nil, the passed dictionary will be used to override
* the environment. If you want to add to the existing
* environment, you need to get the existing environment
* first, copy it, modify it and then pass it.
* @return A new, autoreleased OFProcess.
*/
+ (instancetype)processWithProgram: (OFString*)program
programName: (OFString*)programName
arguments: (OFArray*)arguments
environment: (OFDictionary*)environment;
arguments: (OFArray OF_GENERIC(OFString*)*)arguments
environment: (OFDictionary OF_GENERIC(OFString*,
OFString*)*)environment;
/*!
* @brief Initializes an already allocated OFProcess with the specified program
* and invokes the program.
*
* @param program The program to execute. If it does not start with a slash, the
* search path specified in PATH is used.
|
︙ | | |
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
|
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
|
-
+
-
+
-
-
+
+
|
*
* @param program The program to execute. If it does not start with a slash, the
* search path specified in PATH is used.
* @param arguments The arguments to pass to the program, or nil
* @return An initialized OFProcess.
*/
- initWithProgram: (OFString*)program
arguments: (OFArray*)arguments;
arguments: (OFArray OF_GENERIC(OFString*)*)arguments;
/*!
* @brief Initializes an already allocated OFProcess with the specified program,
* program name and arguments and invokes the program.
*
* @param program The program to execute. If it does not start with a slash, the
* search path specified in PATH is used.
* @param programName The program name for the program to invoke (argv[0]).
* Usually, this is equal to program.
* @param arguments The arguments to pass to the program, or nil
* @return An initialized OFProcess.
*/
- initWithProgram: (OFString*)program
programName: (OFString*)programName
arguments: (OFArray*)arguments;
arguments: (OFArray OF_GENERIC(OFString*)*)arguments;
/*!
* @brief Initializes an already allocated OFProcess with the specified program,
* program name, arguments and environment and invokes the program.
*
* @param program The program to execute. If it does not start with a slash, the
* search path specified in PATH is used.
* @param programName The program name for the program to invoke (argv[0]).
* Usually, this is equal to program.
* @param arguments The arguments to pass to the program, or nil
* @param environment The environment to pass to the program, or nil. If it is
* non-nil, the passed dictionary will be used to override
* the environment. If you want to add to the existing
* environment, you need to get the existing environment
* first, copy it, modify it and then pass it.
* @return An initialized OFProcess.
*/
- initWithProgram: (OFString*)program
programName: (OFString*)programName
arguments: (OFArray*)arguments
environment: (OFDictionary*)environment;
arguments: (OFArray OF_GENERIC(OFString*)*)arguments
environment: (OFDictionary OF_GENERIC(OFString*, OFString*)*)environment;
/*!
* @brief Closes the write direction of the process.
*
* This method needs to be called for some programs before data can be read,
* since some programs don't start processing before the write direction is
* closed.
*/
- (void)closeForWriting;
@end
|
Modified src/OFRunLoop.h
from [797fb62400]
to [e260344414].
︙ | | |
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
-
+
-
+
|
*/
#import "OFObject.h"
#ifdef OF_HAVE_SOCKETS
# import "OFTCPSocket.h"
#endif
@class OFSortedList;
@class OFSortedList OF_GENERIC(ObjectType);
#ifdef OF_HAVE_THREADS
@class OFMutex;
@class OFCondition;
#endif
#ifdef OF_HAVE_SOCKETS
@class OFKernelEventObserver;
#endif
@class OFMutableDictionary;
@class OFMutableDictionary OF_GENERIC(KeyType, ObjectType);
@class OFTimer;
/*!
* @class OFRunLoop OFRunLoop.h ObjFW/OFRunLoop.h
*
* @brief A class providing a run loop for the application and its processes.
*/
|
︙ | | |
Modified src/OFSet.h
from [c4488446e4]
to [da75a58c99].
︙ | | |
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
-
+
|
#import "OFObject.h"
#import "OFCollection.h"
#import "OFSerialization.h"
/*! @file */
@class OFArray;
@class OFArray OF_GENERIC(ObjectType);
#ifdef OF_HAVE_BLOCKS
/*!
* @brief A block for enumerating an OFSet.
*
* @param object The current object
* @param stop A pointer to a variable that can be set to true to stop the
|
︙ | | |
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
|
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
|
+
+
+
+
+
+
-
-
+
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
+
-
+
+
-
+
+
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
|
* @class OFSet OFSet.h ObjFW/OFSet.h
*
* @brief An abstract class for an unordered set of unique objects.
*
* @warning Do not mutate objects that are in a set! Changing the hash of
* objects in a set breaks the internal representation of the set!
*/
#ifdef OF_HAVE_GENERICS
@interface OFSet <ObjectType>:
#else
# ifndef DOXYGEN
# define ObjectType id
# endif
@interface OFSet: OFObject <OFCollection, OFCopying, OFMutableCopying,
OFSerialization>
@interface OFSet:
#endif
OFObject <OFCollection, OFCopying, OFMutableCopying, OFSerialization>
/*!
* @brief Creates a new set.
*
* @return A new, autoreleased set
*/
+ (instancetype)set;
/*!
* @brief Creates a new set with the specified set.
*
* @param set The set to initialize the set with
* @return A new, autoreleased set with the specified set
*/
+ (instancetype)setWithSet: (OFSet*)set;
+ (instancetype)setWithSet: (OFSet OF_GENERIC(ObjectType)*)set;
/*!
* @brief Creates a new set with the specified array.
*
* @param array The array to initialize the set with
* @return A new, autoreleased set with the specified array
*/
+ (instancetype)setWithArray: (OFArray*)array;
+ (instancetype)setWithArray: (OFArray OF_GENERIC(ObjectType)*)array;
/*!
* @brief Creates a new set with the specified objects.
*
* @param firstObject The first object for the set
* @return A new, autoreleased set with the specified objects
*/
+ (instancetype)setWithObjects: (id)firstObject, ...;
+ (instancetype)setWithObjects: (ObjectType)firstObject, ...;
/*!
* @brief Creates a new set with the specified objects.
*
* @param objects An array of objects for the set
* @param count The number of objects in the specified array
* @return A new, autoreleased set with the specified objects
*/
+ (instancetype)setWithObjects: (id const*)objects
+ (instancetype)setWithObjects: (ObjectType const*)objects
count: (size_t)count;
/*!
* @brief Initializes an already allocated set with the specified set.
*
* @param set The set to initialize the set with
* @return An initialized set with the specified set
*/
- initWithSet: (OFSet*)set;
- initWithSet: (OFSet OF_GENERIC(ObjectType)*)set;
/*!
* @brief Initializes an already allocated set with the specified array.
*
* @param array The array to initialize the set with
* @return An initialized set with the specified array
*/
- initWithArray: (OFArray*)array;
- initWithArray: (OFArray OF_GENERIC(ObjectType)*)array;
/*!
* @brief Initializes an already allocated set with the specified objects.
*
* @param firstObject The first object for the set
* @return An initialized set with the specified objects
*/
- initWithObjects: (id)firstObject, ...;
- initWithObjects: (ObjectType)firstObject, ...;
/*!
* @brief Initializes an already allocated set with the specified objects.
*
* @param objects An array of objects for the set
* @param count The number of objects in the specified array
* @return An initialized set with the specified objects
*/
- initWithObjects: (id const*)objects
- initWithObjects: (ObjectType const*)objects
count: (size_t)count;
/*!
* @brief Initializes an already allocated set with the specified object and
* va_list.
*
* @param firstObject The first object for the set
* @param arguments A va_list with the other objects
* @return An initialized set with the specified object and va_list
*/
- initWithObject: (id)firstObject
- initWithObject: (ObjectType)firstObject
arguments: (va_list)arguments;
/*!
* @brief Returns whether the receiver is a subset of the specified set.
*
* @return Whether the receiver is a subset of the specified set
*/
- (bool)isSubsetOfSet: (OFSet*)set;
- (bool)isSubsetOfSet: (OFSet OF_GENERIC(ObjectType)*)set;
/*!
* @brief Returns whether the receiver and the specified set have at least one
* object in common.
*
* @return Whether the receiver and the specified set have at least one object
* in common
*/
- (bool)intersectsSet: (OFSet*)set;
- (bool)intersectsSet: (OFSet OF_GENERIC(ObjectType)*)set;
/*!
* @brief Creates a new set which contains the objects which are in the
* receiver, but not in the specified set.
*
* @param set The set whose objects will not be in the new set
*/
- (OFSet*)setBySubtractingSet: (OFSet*)set;
- (OFSet OF_GENERIC(ObjectType)*)setBySubtractingSet:
(OFSet OF_GENERIC(ObjectType)*)set;
/*!
* @brief Creates a new set by creating the intersection of the receiver and
* the specified set.
*
* @param set The set to intersect with
*/
- (OFSet*)setByIntersectingWithSet: (OFSet*)set;
- (OFSet OF_GENERIC(ObjectType)*)setByIntersectingWithSet:
(OFSet OF_GENERIC(ObjectType)*)set;
/*!
* @brief Creates a new set by creating the union of the receiver and the
* specified set.
*
* @param set The set to create the union with
*/
- (OFSet*)setByAddingSet: (OFSet*)set;
- (OFSet OF_GENERIC(ObjectType)*)setByAddingSet:
(OFSet OF_GENERIC(ObjectType)*)set;
/*!
* @brief Returns an array of all objects in the set.
*
* @return An array of all objects in the set
*/
- (OFArray*)allObjects;
- (OFArray OF_GENERIC(ObjectType)*)allObjects;
/*!
* @brief Returns an arbitrary object in the set.
*
* @return An arbitrary object in the set
*/
- (id)anyObject;
- (ObjectType)anyObject;
/*!
* @brief Checks whether the set contains an object equal to the specified
* object.
*
* @param object The object which is checked for being in the set
* @return A boolean whether the set contains the specified object
*/
- (bool)containsObject: (ObjectType)object;
/*!
* @brief Returns an OFEnumerator to enumerate through all objects of the set.
*
* @returns An OFEnumerator to enumerate through all objects of the set
*/
- (OFEnumerator OF_GENERIC(ObjectType)*)objectEnumerator;
#ifdef OF_HAVE_BLOCKS
/*!
* @brief Executes a block for each object in the set.
*
* @param block The block to execute for each object in the set
*/
- (void)enumerateObjectsUsingBlock: (of_set_enumeration_block_t)block;
/*!
* @brief Creates a new set, only containing the objects for which the block
* returns true.
*
* @param block A block which determines if the object should be in the new set
* @return A new, autoreleased OFSet
*/
- (OFSet OF_GENERIC(ObjectType)*)filteredSetUsingBlock:
- (OFSet*)filteredSetUsingBlock: (of_set_filter_block_t)block;
(of_set_filter_block_t)block;
#endif
@end
#if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN)
# undef ObjectType
#endif
#import "OFMutableSet.h"
|
Modified src/OFSettings.h
from [612a70eebb]
to [0d8a20bfc8].
︙ | | |
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
-
+
|
* LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
* file.
*/
#import "OFObject.h"
@class OFString;
@class OFArray;
@class OFArray OF_GENERIC(ObjectType);
/*!
* @class OFSettings OFSettings.h ObjFW/OFSettings.h
*
* Paths are delimited by dots, for example `category.subcategory.key`.
*
* @note The behaviour when accessing a path with a different type than it has
|
︙ | | |
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
|
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
|
-
+
|
/*!
* @brief Sets the specified path to the specified array of strings.
*
* @param array The array of strings to set
* @param path The path to store the array of strings at
*/
- (void)setArray: (OFArray*)array
- (void)setArray: (OFArray OF_GENERIC(OFString*)*)array
forPath: (OFString*)path;
/*!
* @brief Returns the string for the specified path, or nil if the path does
* not exist.
*
* @param path The path for which the string value should be returned
|
︙ | | |
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
|
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
|
-
+
|
/*!
* @brief Returns the array of strings for the specified path, or an empty
* array if the path does not exist.
*
* @param path The path for which the array of strings should be returned
* @return The array of strings of the specified path
*/
- (OFArray*)arrayForPath: (OFString*)path;
- (OFArray OF_GENERIC(OFString*)*)arrayForPath: (OFString*)path;
/*!
* @brief Removes the value for the specified path.
*
* @param path The path for which the value should be removed
*/
- (void)removeValueForPath: (OFString*)path;
|
︙ | | |
Modified src/OFSortedList.h
from [fee4a78684]
to [df204b4c51].
︙ | | |
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
+
+
+
+
+
+
+
-
+
+
+
+
|
* @class OFSortedList OFSortedList.h ObjFW/OFSortedList.h
*
* @brief A class which provides easy to use sorted double-linked lists.
*
* @warning Because the list is sorted, all methods inserting an object at a
* specific place are unavailable, even though they exist in OFList!
*/
#ifdef OF_HAVE_GENERICS
@interface OFSortedList <ObjectType>: OFList <ObjectType>
#else
# ifndef DOXYGEN
# define ObjectType id
# endif
@interface OFSortedList: OFList
#endif
/*!
* @brief Inserts the object to the list while keeping the list sorted.
*
* @param object The object to insert
* @return The list object for the object just added
*/
- (of_list_object_t*)insertObject: (id <OFComparing>)object;
- (of_list_object_t*)insertObject: (ObjectType <OFComparing>)object;
@end
#if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN)
# undef ObjectType
#endif
|
Modified src/OFString.h
from [d43c26adbd]
to [727e3bcb81].
︙ | | |
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
|
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
|
-
+
|
* @param line The current line
* @param stop A pointer to a variable that can be set to true to stop the
* enumeration
*/
typedef void (^of_string_line_enumeration_block_t)(OFString *line, bool *stop);
#endif
@class OFArray;
@class OFArray OF_GENERIC(ObjectType);
@class OFURL;
/*!
* @class OFString OFString.h ObjFW/OFString.h
*
* @brief A class for handling strings.
*/
|
︙ | | |
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
|
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
|
-
+
|
/*!
* @brief Creates a path from the specified path components.
*
* @param components An array of components for the path
* @return A new autoreleased OFString
*/
+ (OFString*)pathWithComponents: (OFArray*)components;
+ (OFString*)pathWithComponents: (OFArray OF_GENERIC(OFString*)*)components;
/*!
* @brief Initializes an already allocated OFString from a UTF-8 encoded C
* string.
*
* @param UTF8String A UTF-8 encoded C string to initialize the OFString with
* @return An initialized OFString
|
︙ | | |
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
|
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
|
+
-
+
+
-
-
+
+
-
+
|
/*!
* @brief Separates an OFString into an OFArray of OFStrings.
*
* @param delimiter The delimiter for separating
* @return An autoreleased OFArray with the separated string
*/
- (OFArray OF_GENERIC(OFString*)*)componentsSeparatedByString:
- (OFArray*)componentsSeparatedByString: (OFString*)delimiter;
(OFString*)delimiter;
/*!
* @brief Separates an OFString into an OFArray of OFStrings.
*
* @param delimiter The delimiter for separating
* @param options Options according to which the string should be separated.@n
* Possible values are:
* Value | Description
* -----------------------|----------------------
* `OF_STRING_SKIP_EMPTY` | Skip empty components
* @return An autoreleased OFArray with the separated string
*/
- (OFArray OF_GENERIC(OFString*)*)
- (OFArray*)componentsSeparatedByString: (OFString*)delimiter
options: (int)options;
componentsSeparatedByString: (OFString*)delimiter
options: (int)options;
/*!
* @brief Returns the components of the path.
*
* @return The components of the path
*/
- (OFArray*)pathComponents;
- (OFArray OF_GENERIC(OFString*)*)pathComponents;
/*!
* @brief Returns the last component of the path.
*
* @return The last component of the path
*/
- (OFString*)lastPathComponent;
|
︙ | | |
Modified src/OFTLSSocket.h
from [59dd8c2542]
to [a7cdac098b].
︙ | | |
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
-
+
|
* LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
* file.
*/
#import "objfw-defs.h"
@class OFString;
@class OFDictionary;
@class OFDictionary OF_GENERIC(KeyType, ObjectType);
@protocol OFTLSSocket;
/*!
* @protocol OFTLSSocketDelegate OFTLSSocket.h ObjFW/OFTLSSocket.h
*
* @brief A delegate for classes implementing the OFTLSSocket protocol.
*/
|
︙ | | |
Modified src/OFThread.h
from [d6ac7e25ad]
to [2d3c3b4342].
︙ | | |
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
-
+
|
# import "threading.h"
#endif
/*! @file */
@class OFDate;
@class OFRunLoop;
@class OFMutableDictionary;
@class OFMutableDictionary OF_GENERIC(KeyType, ObjectType);
#if defined(OF_HAVE_THREADS) && defined(OF_HAVE_BLOCKS)
/*!
* @brief A block to be executed in a new thread.
*
* @return The object which should be returned when the thread is joined
*/
|
︙ | | |
Modified src/OFThreadPool.h
from [ebd5f6cfdd]
to [e4268d9aa1].
︙ | | |
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
+
-
-
+
+
+
|
#ifdef OF_HAVE_BLOCKS
/*!
* @brief A block for a job which should be executed in a thread pool.
*/
typedef void (^of_thread_pool_block_t)(void);
#endif
#ifndef DOXYGEN
@class OFMutableArray;
@class OFList;
@class OFMutableArray OF_GENERIC(ObjectType);
@class OFList OF_GENERIC(ObjectType);
#endif
@class OFCondition;
@class OFThreadPoolJob;
/*!
* @class OFThreadPool OFThreadPool.h ObjFW/OFThreadPool.h
*
* @brief A class providing a pool of reusable threads.
|
︙ | | |
Modified src/OFXMLElement.h
from [34a206efac]
to [3275f15b38].
︙ | | |
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
-
+
+
-
-
+
+
+
-
-
-
+
+
+
-
-
+
+
|
* LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
* file.
*/
#import "OFXMLNode.h"
@class OFString;
@class OFArray;
@class OFMutableString;
#ifndef DOXYGEN
@class OFArray OF_GENERIC(ObjectType);
@class OFMutableArray;
@class OFMutableDictionary;
@class OFMutableArray OF_GENERIC(ObjectType);
@class OFMutableDictionary OF_GENERIC(KeyType, ObjectType);
#endif
@class OFXMLAttribute;
/*!
* @class OFXMLElement OFXMLElement.h ObjFW/OFXMLElement.h
*
* @brief A class which stores an XML element.
*/
@interface OFXMLElement: OFXMLNode
{
OFString *_name, *_namespace, *_defaultNamespace;
OFMutableArray *_attributes;
OFMutableDictionary *_namespaces;
OFMutableArray *_children;
OFMutableArray OF_GENERIC(OFXMLAttribute*) *_attributes;
OFMutableDictionary OF_GENERIC(OFString*, OFString*) *_namespaces;
OFMutableArray OF_GENERIC(OFXMLNode*) *_children;
}
#ifdef OF_HAVE_PROPERTIES
@property (copy) OFString *name;
# ifdef __cplusplus
@property (copy, getter=namespace, setter=setNamespace:) OFString *namespace_;
# else
@property (copy) OFString *namespace;
# endif
@property (copy) OFString *defaultNamespace;
@property (readonly, copy) OFArray *attributes;
@property (copy) OFArray *children;
@property (readonly, copy) OFArray OF_GENERIC(OFXMLAttribute*) *attributes;
@property (copy) OFArray OF_GENERIC(OFXMLNode*) *children;
#endif
/*!
* @brief Creates a new XML element with the specified name.
*
* @param name The name for the element
* @return A new autoreleased OFXMLElement with the specified element name
|
︙ | | |
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
|
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
|
-
+
-
+
-
+
|
- (OFString*)namespace;
/*!
* @brief Returns an OFArray with the attributes of the element.
*
* @return An OFArray with the attributes of the element
*/
- (OFArray*)attributes;
- (OFArray OF_GENERIC(OFXMLAttribute*)*)attributes;
/*!
* @brief Removes all children and adds the children from the specified array.
*
* @param children The new children to add
*/
- (void)setChildren: (OFArray*)children;
- (void)setChildren: (OFArray OF_GENERIC(OFXMLNode*)*)children;
/*!
* @brief Returns an array of OFXMLNodes with all children of the element.
*
* @return An array of OFXMLNodes with all children of the element
*/
- (OFArray*)children;
- (OFArray OF_GENERIC(OFXMLNode*)*)children;
/*!
* @brief Adds the specified attribute.
*
* If an attribute with the same name and namespace already exists, it is not
* added.
*
|
︙ | | |
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
|
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
|
-
+
|
/*!
* @brief Inserts the specified children at the specified index.
*
* @param children An array of OFXMLNodes which are added as children
* @param index The index where the child is added
*/
- (void)insertChildren: (OFArray*)children
- (void)insertChildren: (OFArray OF_GENERIC(OFXMLNode*)*)children
atIndex: (size_t)index;
/*!
* @brief Removes the first child that is equal to the specified OFXMLNode.
*
* @param child The child to remove from the OFXMLElement
*/
|
︙ | | |
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
|
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
|
-
+
+
-
+
-
+
-
-
+
+
|
withNode: (OFXMLNode*)node;
/*!
* @brief Returns all children that are elements.
*
* @return All children that are elements
*/
- (OFArray*)elements;
- (OFArray OF_GENERIC(OFXMLElement*)*)elements;
/*!
* @brief Returns all children that have the specified namespace.
*
* @return All children that have the specified namespace
*/
- (OFArray OF_GENERIC(OFXMLElement*)*)elementsForNamespace:
- (OFArray*)elementsForNamespace: (OFString*)elementNS;
(OFString*)elementNS;
/*!
* @brief Returns the first child element with the specified name.
*
* @param elementName The name of the element
* @return The first child element with the specified name
*/
- (OFXMLElement*)elementForName: (OFString*)elementName;
/*!
* @brief Returns the child elements with the specified name.
*
* @param elementName The name of the elements
* @return The child elements with the specified name
*/
- (OFArray*)elementsForName: (OFString*)elementName;
- (OFArray OF_GENERIC(OFXMLElement*)*)elementsForName: (OFString*)elementName;
/*!
* @brief Returns the first child element with the specified name and namespace.
*
* @param elementName The name of the element
* @param elementNS The namespace of the element
* @return The first child element with the specified name and namespace
*/
- (OFXMLElement*)elementForName: (OFString*)elementName
namespace: (OFString*)elementNS;
/*!
* @brief Returns the child elements with the specified name and namespace.
*
* @param elementName The name of the elements
* @param elementNS The namespace of the elements
* @return The child elements with the specified name and namespace
*/
- (OFArray*)elementsForName: (OFString*)elementName
namespace: (OFString*)elementNS;
- (OFArray OF_GENERIC(OFXMLElement*)*)elementsForName: (OFString*)elementName
namespace: (OFString*)elementNS;
@end
#import "OFXMLElement+Serialization.h"
|
Modified src/OFXMLElement.m
from [122abe4075]
to [b449554094].
︙ | | |
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
|
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
|
-
+
|
objc_autoreleasePoolPop(pool);
}
- (OFString*)stringValue
{
OFMutableString *ret;
OFXMLElement *const *objects;
OFXMLNode *const *objects;
size_t i, count = [_children count];
if (count == 0)
return @"";
ret = [OFMutableString string];
objects = [_children objects];
|
︙ | | |
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
|
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
|
-
+
|
cString[i++] = '\'';
objc_autoreleasePoolPop(pool2);
}
/* Childen */
if (_children != nil) {
OFXMLElement *const *childrenObjects = [_children objects];
OFXMLNode *const *childrenObjects = [_children objects];
size_t childrenCount = [_children count];
OFDataArray *tmp = [OFDataArray dataArray];
bool indent;
if (indentation > 0) {
indent = true;
|
︙ | | |
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
|
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
|
-
+
|
unsigned int ind = (indent ? indentation : 0);
if (ind)
[tmp addItem: "\n"];
if ([childrenObjects[j] isKindOfClass:
[OFXMLElement class]])
child = [childrenObjects[j]
child = [(OFXMLElement*)childrenObjects[j]
OF_XMLStringWithParent: self
namespaces: allNamespaces
indentation: ind
level: level + 1];
else
child = [childrenObjects[j]
XMLStringWithIndentation: ind
|
︙ | | |
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
|
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
|
-
-
+
+
-
+
-
-
+
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
+
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
+
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
|
{
return [[self elementsForName: elementName
namespace: elementNS] firstObject];
}
- (OFArray*)elements
{
OFMutableArray *ret = [OFMutableArray array];
OFXMLElement *const *objects = [_children objects];
OFMutableArray OF_GENERIC(OFXMLElement*) *ret = [OFMutableArray array];
OFXMLNode *const *objects = [_children objects];
size_t i, count = [_children count];
for (i = 0; i < count; i++)
if ([objects[i] isKindOfClass: [OFXMLElement class]])
[ret addObject: objects[i]];
[ret addObject: (OFXMLElement*)objects[i]];
[ret makeImmutable];
return ret;
}
- (OFArray*)elementsForName: (OFString*)elementName
{
OFMutableArray *ret = [OFMutableArray array];
OFXMLElement *const *objects = [_children objects];
OFMutableArray OF_GENERIC(OFXMLElement*) *ret = [OFMutableArray array];
OFXMLNode *const *objects = [_children objects];
size_t i, count = [_children count];
for (i = 0; i < count; i++)
if ([objects[i] isKindOfClass: [OFXMLElement class]] &&
objects[i]->_namespace == nil &&
[objects[i]->_name isEqual: elementName])
[ret addObject: objects[i]];
for (i = 0; i < count; i++) {
if ([objects[i] isKindOfClass: [OFXMLElement class]]) {
OFXMLElement *element = (OFXMLElement*)objects[i];
if (element->_namespace == nil &&
[element->_name isEqual: elementName])
[ret addObject: element];
}
}
[ret makeImmutable];
return ret;
}
- (OFArray*)elementsForNamespace: (OFString*)elementNS
{
OFMutableArray *ret = [OFMutableArray array];
OFXMLElement *const *objects = [_children objects];
OFMutableArray OF_GENERIC(OFXMLElement*) *ret = [OFMutableArray array];
OFXMLNode *const *objects = [_children objects];
size_t i, count = [_children count];
for (i = 0; i < count; i++)
if ([objects[i] isKindOfClass: [OFXMLElement class]] &&
objects[i]->_name != nil &&
[objects[i]->_namespace isEqual: elementNS])
[ret addObject: objects[i]];
for (i = 0; i < count; i++) {
if ([objects[i] isKindOfClass: [OFXMLElement class]]) {
OFXMLElement *element = (OFXMLElement*)objects[i];
if (element->_name != nil &&
[element->_namespace isEqual: elementNS])
[ret addObject: element];
}
}
[ret makeImmutable];
return ret;
}
- (OFArray*)elementsForName: (OFString*)elementName
namespace: (OFString*)elementNS
{
OFMutableArray *ret;
OFXMLElement *const *objects;
OFMutableArray OF_GENERIC(OFXMLElement*) *ret;
OFXMLNode *const *objects;
size_t i, count;
if (elementNS == nil)
return [self elementsForName: elementName];
ret = [OFMutableArray array];
objects = [_children objects];
count = [_children count];
for (i = 0; i < count; i++)
if ([objects[i] isKindOfClass: [OFXMLElement class]] &&
[objects[i]->_namespace isEqual: elementNS] &&
[objects[i]->_name isEqual: elementName])
[ret addObject: objects[i]];
for (i = 0; i < count; i++) {
if ([objects[i] isKindOfClass: [OFXMLElement class]]) {
OFXMLElement *element = (OFXMLElement*)objects[i];
if ([element->_namespace isEqual: elementNS] &&
[element->_name isEqual: elementName])
[ret addObject: element];
}
}
[ret makeImmutable];
return ret;
}
- (bool)isEqual: (id)object
|
︙ | | |
Modified src/OFXMLElementBuilder.h
from [7cac4f989f]
to [bc1c1fb01a].
︙ | | |
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
-
+
|
* LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
* file.
*/
#import "OFObject.h"
#import "OFXMLParser.h"
@class OFMutableArray;
@class OFMutableArray OF_GENERIC(ObjectType);
@class OFXMLElement;
@class OFXMLElementBuilder;
/*!
* @protocol OFXMLElementBuilderDelegate
* OFXMLElementBuilder.h ObjFW/OFXMLElementBuilder.h
*
|
︙ | | |
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
|
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
|
-
+
|
*
* It can also be used to build OFXMLElements from parts of the document by
* first parsing stuff using the OFXMLParser with another delegate and then
* setting the OFXMLElementBuilder as delegate for the parser.
*/
@interface OFXMLElementBuilder: OFObject <OFXMLParserDelegate>
{
OFMutableArray *_stack;
OFMutableArray OF_GENERIC(OFXMLElement*) *_stack;
id <OFXMLElementBuilderDelegate> _delegate;
}
#ifdef OF_HAVE_PROPERTIES
@property (assign) id <OFXMLElementBuilderDelegate> delegate;
#endif
|
︙ | | |
Modified src/OFXMLParser.h
from [20a68c11c5]
to [fa3cd926f4].
︙ | | |
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
+
-
-
+
+
+
+
|
*/
#import "OFObject.h"
#import "OFString.h"
#import "OFXMLAttribute.h"
@class OFXMLParser;
#ifndef DOXYGEN
@class OFArray;
@class OFMutableArray;
@class OFArray OF_GENERIC(ObjectType);
@class OFMutableArray OF_GENERIC(ObjectType);
@class OFMutableDictionary OF_GENERIC(KeyType, ObjectType);
#endif
@class OFDataArray;
@class OFStream;
/*!
* @protocol OFXMLParserDelegate OFXMLParser.h ObjFW/OFXMLParser.h
*
* @brief A protocol that needs to be implemented by delegates for OFXMLParser.
|
︙ | | |
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
-
+
|
* @param attributes The attributes included in the tag which just started or
* nil
*/
- (void)parser: (OFXMLParser*)parser
didStartElement: (OFString*)name
prefix: (OFString*)prefix
namespace: (OFString*)ns
attributes: (OFArray*)attributes;
attributes: (OFArray OF_GENERIC(OFXMLAttribute*)*)attributes;
/*!
* @brief This callback is called when the XML parser found the end of a tag.
*
* @param parser The parser which found the end of a tag
* @param name The name of the tag which just ended
* @param prefix The prefix of the tag which just ended or nil
|
︙ | | |
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
|
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
|
-
+
+
+
+
-
+
|
OF_XMLPARSER_IN_DOCTYPE,
OF_XMLPARSER_NUM_STATES
} _state;
size_t _i, _last;
const char *_data;
OFDataArray *_buffer;
OFString *_name, *_prefix;
OFMutableArray *_namespaces, *_attributes;
OFMutableArray
OF_GENERIC(OFMutableDictionary OF_GENERIC(OFString*, OFString*)*)
*_namespaces;
OFMutableArray OF_GENERIC(OFXMLAttribute*) *_attributes;
OFString *_attributeName, *_attributePrefix;
char _delimiter;
OFMutableArray *_previous;
OFMutableArray OF_GENERIC(OFString*) *_previous;
size_t _level;
bool _acceptProlog;
size_t _lineNumber;
bool _lastCarriageReturn, _finishedParsing;
of_string_encoding_t _encoding;
size_t _depthLimit;
}
|
︙ | | |
Modified src/OFZIPArchive.h
from [54dc543184]
to [3ce281f546].
︙ | | |
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
+
+
-
-
-
+
+
+
+
-
-
+
+
+
-
+
|
* Public License, either version 2 or 3, which can be found in the file
* LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
* file.
*/
#import "OFObject.h"
#import "OFString.h"
#import "OFZIPArchiveEntry.h"
#ifndef DOXYGEN
@class OFArray;
@class OFMutableArray;
@class OFMutableDictionary;
@class OFArray OF_GENERIC(ObjectType);
@class OFMutableArray OF_GENERIC(ObjectType);
@class OFMutableDictionary OF_GENERIC(KeyType, ObjectType);
#endif
@class OFSeekableStream;
@class OFStream;
/*!
* @class OFZIPArchive OFZIPArchive.h ObjFW/OFZIPArchive.h
*
* @brief A class for accessing and manipulating ZIP files.
*/
@interface OFZIPArchive: OFObject
{
OFSeekableStream *_stream;
uint32_t _diskNumber, _centralDirectoryDisk;
uint64_t _centralDirectoryEntriesInDisk, _centralDirectoryEntries;
uint64_t _centralDirectorySize, _centralDirectoryOffset;
OFString *_archiveComment;
OFMutableArray *_entries;
OFMutableDictionary *_pathToEntryMap;
OFMutableArray OF_GENERIC(OFZIPArchiveEntry*) *_entries;
OFMutableDictionary OF_GENERIC(OFString*, OFZIPArchiveEntry*)
*_pathToEntryMap;
OFStream *_lastReturnedStream;
}
#ifdef OF_HAVE_PROPERTIES
@property (readonly, copy) OFString *archiveComment;
@property (readonly, copy) OFArray *entries;
@property (readonly, copy) OFArray OF_GENERIC(OFZIPArchiveEntry*) *entries;
#endif
/*!
* @brief Creates a new OFZIPArchive object with the specified seekable stream.
*
* @param stream A seekable stream from which the ZIP archive will be read
* @return A new, autoreleased OFZIPArchive
|
︙ | | |
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
|
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
|
-
+
|
*
* The objects of the array have the same order as the entries in the central
* directory, which does not need to be the order in which the actual files are
* stored.
*
* @return The entries of the central directory of the archive as an array
*/
- (OFArray*)entries;
- (OFArray OF_GENERIC(OFZIPArchiveEntry*)*)entries;
/*!
* @brief Returns the archive comment.
*
* @return The archive comment
*/
- (OFString*)archiveComment;
|
︙ | | |
Modified src/exceptions/OFException.h
from [81451deb50]
to [27f0d07f48].
︙ | | |
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
+
-
-
+
+
+
|
* LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
* file.
*/
#import "OFObject.h"
@class OFString;
#ifndef DOXYGEN
@class OFArray;
@class OFMutableArray;
@class OFArray OF_GENERIC(ObjectType);
@class OFMutableArray OF_GENERIC(ObjectType);
#endif
#define OF_BACKTRACE_SIZE 32
#if defined(_WIN32) && defined(OF_HAVE_SOCKETS)
# ifndef EADDRINUSE
# define EADDRINUSE WSAEADDRINUSE
# endif
|
︙ | | |
Modified src/macros.h
from [f975939415]
to [602c2a02eb].
︙ | | |
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
|
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
|
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
# define __has_feature(x) 0
#endif
#ifndef __has_attribute
# define __has_attribute(x) 0
#endif
#if !__has_feature(objc_instancetype)
# define instancetype id
#endif
#if __has_feature(blocks)
# define OF_HAVE_BLOCKS
#endif
#if __has_feature(objc_bool)
# undef YES
# define YES __objc_yes
# undef NO
# define NO __objc_no
# ifndef __cplusplus
# undef true
# define true ((bool)1)
# undef false
# define false ((bool)0)
# endif
#endif
#if !__has_feature(objc_instancetype)
# define instancetype id
#endif
#if __has_feature(blocks)
# define OF_HAVE_BLOCKS
#endif
#if __has_feature(objc_arc)
# define OF_RETURNS_RETAINED __attribute__((__ns_returns_retained__))
# define OF_RETURNS_NOT_RETAINED __attribute__((__ns_returns_not_retained__))
# define OF_RETURNS_INNER_POINTER \
__attribute__((__objc_returns_inner_pointer__))
# define OF_CONSUMED __attribute__((__ns_consumed__))
# define OF_WEAK_UNAVAILABLE __attribute__((__objc_arc_weak_unavailable__))
#else
# define OF_RETURNS_RETAINED
# define OF_RETURNS_NOT_RETAINED
# define OF_RETURNS_INNER_POINTER
# define OF_CONSUMED
# define OF_WEAK_UNAVAILABLE
# define __unsafe_unretained
# define __bridge
# define __autoreleasing
#endif
#if __has_feature(objc_generics)
# define OF_HAVE_GENERICS
# define OF_GENERIC(...) <__VA_ARGS__>
#else
# define OF_GENERIC(...)
#endif
#if defined(__clang__) || __GCC_VERSION__ >= 405
# define OF_UNREACHABLE __builtin_unreachable();
#else
# define OF_UNREACHABLE abort();
#endif
|
︙ | | |
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
|
279
280
281
282
283
284
285
286
287
288
289
290
291
292
|
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
|
# if __OBJFW_RUNTIME_ABI__ >= 800
# define OF_HAVE_FORWARDING_TARGET_FOR_SELECTOR_STRET
# endif
# endif
# endif
#endif
#if __has_feature(objc_arc)
# define OF_RETURNS_RETAINED __attribute__((__ns_returns_retained__))
# define OF_RETURNS_NOT_RETAINED __attribute__((__ns_returns_not_retained__))
# define OF_RETURNS_INNER_POINTER \
__attribute__((__objc_returns_inner_pointer__))
# define OF_CONSUMED __attribute__((__ns_consumed__))
# define OF_WEAK_UNAVAILABLE __attribute__((__objc_arc_weak_unavailable__))
#else
# define OF_RETURNS_RETAINED
# define OF_RETURNS_NOT_RETAINED
# define OF_RETURNS_INNER_POINTER
# define OF_CONSUMED
# define OF_WEAK_UNAVAILABLE
# define __unsafe_unretained
# define __bridge
# define __autoreleasing
#endif
#define OF_RETAIN_COUNT_MAX UINT_MAX
#define OF_NOT_FOUND SIZE_MAX
#if !defined(_WIN32) && !defined(__DJGPP__)
# define OF_PATH_DELIMITER '/'
# define OF_PATH_DELIMITER_STRING @"/"
# define OF_IS_PATH_DELIMITER(c) (c == '/')
|
︙ | | |