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
26
|
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
26
|
-
+
-
+
|
/*
* Copyright (c) 2008 - 2009
* Copyright (c) 2008 - 2010
* Jonathan Schleifer <js@webkeks.org>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE included in
* the packaging of this file.
*/
#include <sys/stat.h>
#import "OFObject.h"
@class OFString;
/**
* An exception indicating an object could not be allocated.
* \brief An exception indicating an object could not be allocated.
*
* This exception is preallocated, as if there's no memory, no exception can
* be allocated of course. That's why you shouldn't and even can't deallocate
* it.
*
* This is the only exception that is not an OFException as it's special.
* It does not know for which class allocation failed and it should not be
|
︙ | | |
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
+
+
-
+
+
|
/**
* \return An error message for the exception as a string
*/
- (OFString*)string;
@end
/**
* \brief The base class for all exceptions in ObjFW
*
* The OFException class is the base class for all exceptions in ObjFW.
* The OFException class is the base class for all exceptions in ObjFW, except
* the OFAllocFailedException.
*
* IMPORTANT: Exceptions do NOT use OFAutoreleasePools and can't be autoreleased
* either! You have to make sure to dealloc the exception in your \@catch block!
*/
@interface OFException: OFObject
{
Class class_;
|
︙ | | |
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
|
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
|
-
+
|
/**
* \return An error message for the exception as a string
*/
- (OFString*)string;
@end
/**
* An OFException indicating there is not enough memory available.
* \brief An exception indicating there is not enough memory available.
*/
@interface OFOutOfMemoryException: OFException
{
size_t req_size;
}
/**
|
︙ | | |
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
|
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
|
-
+
+
-
+
|
/**
* \return The size of the memoory that couldn't be allocated
*/
- (size_t)requestedSize;
@end
/**
* An OFException indicating that a mutation was detected while enumerating.
* \brief An exception indicating that a mutation was detected while
* enumerating.
*/
@interface OFEnumerationMutationException: OFException {}
@end
/**
* An OFException indicating the given memory is not part of the object.
* \brief An exception indicating the given memory is not part of the object.
*/
@interface OFMemoryNotPartOfObjectException: OFException
{
void *pointer;
}
/**
|
︙ | | |
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
|
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
|
-
+
+
|
/**
* \return A pointer to the memory which is not part of the object
*/
- (void*)pointer;
@end
/**
* An OFException indicating that a method or part of it is not implemented.
* \brief An exception indicating that a method or part of it is not
* implemented.
*/
@interface OFNotImplementedException: OFException
{
SEL selector;
}
/**
|
︙ | | |
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
|
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
|
-
+
-
+
|
* \return An initialized not implemented exception
*/
- initWithClass: (Class)class_
selector: (SEL)selector;
@end
/**
* An OFException indicating the given value is out of range.
* \brief An exception indicating the given value is out of range.
*/
@interface OFOutOfRangeException: OFException {}
@end
/**
* An OFException indicating that the argument is invalid for this method.
* \brief An exception indicating that the argument is invalid for this method.
*/
@interface OFInvalidArgumentException: OFException
{
SEL selector;
}
/**
|
︙ | | |
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
|
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
|
-
+
-
+
-
+
+
-
+
-
+
|
* \return An initialized invalid argument exception
*/
- initWithClass: (Class)class_
selector: (SEL)selector;
@end
/**
* An OFException indicating that the encoding is invalid for this object.
* \brief An exception indicating that the encoding is invalid for this object.
*/
@interface OFInvalidEncodingException: OFException {}
@end
/**
* An OFException indicating that the format is invalid.
* \brief An exception indicating that the format is invalid.
*/
@interface OFInvalidFormatException: OFException {}
@end
/**
* An OFException indicating that a parser encountered malformed or invalid XML.
* \brief An exception indicating that a parser encountered malformed or
* invalid XML.
*/
@interface OFMalformedXMLException: OFException {}
@end
/**
* An OFException indicating that initializing something failed.
* \brief An exception indicating that initializing something failed.
*/
@interface OFInitializationFailedException: OFException {}
@end
/**
* An OFException indicating the file couldn't be opened.
* \brief An exception indicating the file couldn't be opened.
*/
@interface OFOpenFileFailedException: OFException
{
OFString *path;
OFString *mode;
int err;
}
|
︙ | | |
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
|
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
|
-
+
|
/**
* \return A string of the mode in which the file should have been opened
*/
- (OFString*)mode;
@end
/**
* An OFException indicating a read or write to the file failed.
* \brief An exception indicating a read or write to the file failed.
*/
@interface OFReadOrWriteFailedException: OFException
{
size_t req_size;
int err;
}
|
︙ | | |
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
|
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
|
-
+
-
+
-
+
|
/**
* \return The requested size of the data that couldn't be read / written
*/
- (size_t)requestedSize;
@end
/**
* An OFException indicating a read on the file failed.
* \brief An exception indicating a read on a file failed.
*/
@interface OFReadFailedException: OFReadOrWriteFailedException {}
@end
/**
* An OFException indicating a write to the file failed.
* \brief An exception indicating a write to a file failed.
*/
@interface OFWriteFailedException: OFReadOrWriteFailedException {}
@end
/**
* An OFException indicating that changing the mode of the file failed.
* \brief An exception indicating that changing the mode of a file failed.
*/
@interface OFChangeFileModeFailedException: OFException
{
OFString *path;
mode_t mode;
int err;
}
|
︙ | | |
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
|
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
|
-
+
|
* \return The new mode for the file
*/
- (mode_t)mode;
@end
#ifndef _WIN32
/**
* An OFException indicating that changing the owner of the file failed.
* \brief An exception indicating that changing the owner of a file failed.
*/
@interface OFChangeFileOwnerFailedException: OFException
{
OFString *path;
uid_t owner;
gid_t group;
int err;
|
︙ | | |
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
|
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
|
-
+
|
* \return The new group for the file
*/
- (gid_t)group;
@end
#endif
/**
* An OFException indicating that renaming a file failed.
* \brief An exception indicating that renaming a file failed.
*/
@interface OFRenameFileFailedException: OFException
{
OFString *from;
OFString *to;
int err;
}
|
︙ | | |
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
|
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
|
-
+
|
/**
* \return The new path
*/
- (OFString*)to;
@end
/**
* An OFException indicating that deleting a file failed.
* \brief An exception indicating that deleting a file failed.
*/
@interface OFDeleteFileFailedException: OFException
{
OFString *path;
int err;
}
|
︙ | | |
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
|
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
|
-
+
|
* \return The path of the file
*/
- (OFString*)path;
@end
#ifndef _WIN32
/**
* An OFException indicating that creating a link failed.
* \brief An exception indicating that creating a link failed.
*/
@interface OFLinkFailedException: OFException
{
OFString *src;
OFString *dest;
int err;
}
|
︙ | | |
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
|
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
|
-
+
|
/**
* \return A string of the destination for the link
*/
- (OFString*)destination;
@end
/**
* An OFException indicating that creating a symlink failed.
* \brief An exception indicating that creating a symlink failed.
*/
@interface OFSymlinkFailedException: OFException
{
OFString *src;
OFString *dest;
int err;
}
|
︙ | | |
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
|
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
|
-
+
-
+
-
-
+
+
-
+
|
* \return A string of the destination for the symlink
*/
- (OFString*)destination;
@end
#endif
/**
* An OFException indicating that setting an option failed.
* \brief An exception indicating that setting an option failed.
*/
@interface OFSetOptionFailedException: OFException {}
@end
/**
* An OFException indicating a socket is not connected or bound.
* \brief An exception indicating a socket is not connected or bound.
*/
@interface OFNotConnectedException: OFException {}
@end
/**
* An OFException indicating an attempt to connect or bind an already connected
* or bound socket.
* \brief An exception indicating an attempt to connect or bind an already
* connected or bound socket.
*/
@interface OFAlreadyConnectedException: OFException {}
@end
/**
* An OFException indicating the translation of an address failed.
* \brief An exception indicating the translation of an address failed.
*/
@interface OFAddressTranslationFailedException: OFException
{
OFString *node;
OFString *service;
int err;
}
|
︙ | | |
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
|
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
|
-
+
|
/**
* \return The service of the node for which translation was requested
*/
- (OFString*)service;
@end
/**
* An OFException indicating that the connection could not be established.
* \brief An exception indicating that the connection could not be established.
*/
@interface OFConnectionFailedException: OFException
{
OFString *node;
OFString *service;
int err;
}
|
︙ | | |
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
|
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
|
-
+
|
/**
* \return The service on the node to which the connection failed
*/
- (OFString*)service;
@end
/**
* An OFException indicating that binding the socket failed.
* \brief An exception indicating that binding the socket failed.
*/
@interface OFBindFailedException: OFException
{
OFString *node;
OFString *service;
int family;
int err;
|
︙ | | |
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
|
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
|
-
+
|
/**
* \return The family for which binding failed
*/
- (int)family;
@end
/**
* An OFException indicating that listening on the socket failed.
* \brief An exception indicating that listening on the socket failed.
*/
@interface OFListenFailedException: OFException
{
int backlog;
int err;
}
|
︙ | | |
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
|
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
|
-
+
-
+
-
+
-
+
-
+
|
/**
* \return The requested back log.
*/
- (int)backLog;
@end
/**
* An OFException indicating that accepting a connection failed.
* \brief An exception indicating that accepting a connection failed.
*/
@interface OFAcceptFailedException: OFException
{
int err;
}
/**
* \return The errno from when the exception was created
*/
- (int)errNo;
@end
/**
* An OFException indicating that joining the thread failed.
* \brief An exception indicating that joining the thread failed.
*/
@interface OFThreadJoinFailedException: OFException {}
@end
/**
* An OFException indicating that locking a mutex failed.
* \brief An exception indicating that locking a mutex failed.
*/
@interface OFMutexLockFailedException: OFException {}
@end
/**
* An OFException indicating that unlocking a mutex failed.
* \brief An exception indicating that unlocking a mutex failed.
*/
@interface OFMutexUnlockFailedException: OFException {}
@end
/**
* An OFException indicating that the hash has already been calculated.
* \brief An exception indicating that the hash has already been calculated.
*/
@interface OFHashAlreadyCalculatedException: OFException {}
@end
|