ObjFW  Diff

Differences From Artifact [52c201d27f]:

To Artifact [744b7f16c3]:


24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#if defined(OF_APPLE_RUNTIME) || defined(OF_GNU_RUNTIME)
# import <objc/runtime.h>
#endif

#ifdef OF_OLD_GNU_RUNTIME
# import <objc/objc-api.h>
# define sel_getName(x) sel_get_name(x)
# define class_getName class_get_class_name
#endif

#import "OFExceptions.h"
#import "OFString.h"
#import "OFTCPSocket.h"
#import "OFHTTPRequest.h"
#import "OFAutoreleasePool.h"







<







24
25
26
27
28
29
30

31
32
33
34
35
36
37
#if defined(OF_APPLE_RUNTIME) || defined(OF_GNU_RUNTIME)
# import <objc/runtime.h>
#endif

#ifdef OF_OLD_GNU_RUNTIME
# import <objc/objc-api.h>
# define sel_getName(x) sel_get_name(x)

#endif

#import "OFExceptions.h"
#import "OFString.h"
#import "OFTCPSocket.h"
#import "OFHTTPRequest.h"
#import "OFAutoreleasePool.h"
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
- (OFString*)description
{
	if (description != nil)
		return description;

	if (requestedSize)
		description = [[OFString alloc] initWithFormat:
		    @"Could not allocate %zu bytes in class %s!", requestedSize,
		    class_getName(inClass)];
	else
		description = [[OFString alloc] initWithFormat:
		    @"Could not allocate enough memory in class %s!",
		    class_getName(inClass)];

	return description;
}

- (size_t)requestedSize
{
	return requestedSize;
}
@end

@implementation OFEnumerationMutationException
- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"Object of class %s was mutated during enumeration!",
	    class_getName(inClass)];

	return description;
}
@end

@implementation OFMemoryNotPartOfObjectException
+ newWithClass: (Class)class_







|
|


|
<

















|
<







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
- (OFString*)description
{
	if (description != nil)
		return description;

	if (requestedSize)
		description = [[OFString alloc] initWithFormat:
		    @"Could not allocate %zu bytes in class %@!", requestedSize,
		    inClass];
	else
		description = [[OFString alloc] initWithFormat:
		    @"Could not allocate enough memory in class %@!", inClass];


	return description;
}

- (size_t)requestedSize
{
	return requestedSize;
}
@end

@implementation OFEnumerationMutationException
- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"Object of class %@ was mutated during enumeration!", inClass];


	return description;
}
@end

@implementation OFMemoryNotPartOfObjectException
+ newWithClass: (Class)class_
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297

- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"Memory at %p was not allocated as part of object of class %s, "
	    @"thus the memory allocation was not changed! It is also possible "
	    @"that there was an attempt to free the same memory twice.",
	    pointer, class_getName(inClass)];

	return description;
}

- (void*)pointer
{
	return pointer;







|


|







277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294

- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"Memory at %p was not allocated as part of object of class %@, "
	    @"thus the memory allocation was not changed! It is also possible "
	    @"that there was an attempt to free the same memory twice.",
	    pointer, inClass];

	return description;
}

- (void*)pointer
{
	return pointer;
326
327
328
329
330
331
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

- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"The method %s of class %s is not or not fully implemented!",
	    sel_getName(selector), class_getName(inClass)];

	return description;
}

- (SEL)selector
{
	return selector;
}
@end

@implementation OFOutOfRangeException
- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"Value out of range in class %s!", class_getName(inClass)];

	return description;
}
@end

@implementation OFInvalidArgumentException
+ newWithClass: (Class)class_







|
|

















|







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
349
350
351
352
353
354
355
356

- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"The method %s of class %@ is not or not fully implemented!",
	    sel_getName(selector), inClass];

	return description;
}

- (SEL)selector
{
	return selector;
}
@end

@implementation OFOutOfRangeException
- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"Value out of range in class %@!", inClass];

	return description;
}
@end

@implementation OFInvalidArgumentException
+ newWithClass: (Class)class_
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
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

- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"The argument for method %s of class %s is invalid!",
	    sel_getName(selector), class_getName(inClass)];

	return description;
}

- (SEL)selector
{
	return selector;
}
@end

@implementation OFInvalidEncodingException
- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"The encoding is invalid for class %s!", class_getName(inClass)];

	return description;
}
@end

@implementation OFInvalidFormatException
- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"The format is invalid for class %s!", class_getName(inClass)];

	return description;
}
@end

@implementation OFMalformedXMLException
- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"The parser in class %s encountered malformed or invalid XML!",
	    class_getName(inClass)];

	return description;
}
@end

@implementation OFInitializationFailedException
- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"Initialization failed for class %s!", class_getName(inClass)];

	return description;
}
@end

@implementation OFOpenFileFailedException
+ newWithClass: (Class)class_







|
|

















|












|












|
<












|







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
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

- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"The argument for method %s of class %@ is invalid!",
	    sel_getName(selector), inClass];

	return description;
}

- (SEL)selector
{
	return selector;
}
@end

@implementation OFInvalidEncodingException
- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"The encoding is invalid for class %@!", inClass];

	return description;
}
@end

@implementation OFInvalidFormatException
- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"The format is invalid for class %@!", inClass];

	return description;
}
@end

@implementation OFMalformedXMLException
- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"The parser in class %@ encountered malformed XML!", inClass];


	return description;
}
@end

@implementation OFInitializationFailedException
- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"Initialization failed for or in class %@!", inClass];

	return description;
}
@end

@implementation OFOpenFileFailedException
+ newWithClass: (Class)class_
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513

- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"Failed to open file %@ with mode %@ in class %s! " ERRFMT, path,
	    mode, class_getName(inClass), ERRPARAM];

	return description;
}

- (int)errNo
{
	return errNo;







|
|







494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509

- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"Failed to open file %@ with mode %@ in class %@! " ERRFMT, path,
	    mode, inClass, ERRPARAM];

	return description;
}

- (int)errNo
{
	return errNo;
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
@implementation OFReadFailedException
- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"Failed to read %zu bytes in class %s! " ERRFMT, requestedSize,
	    class_getName(inClass), ERRPARAM];

	return description;
}
@end

@implementation OFWriteFailedException
- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"Failed to write %zu bytes in class %s! " ERRFMT, requestedSize,
	    class_getName(inClass), ERRPARAM];

	return description;
}
@end

@implementation OFSeekFailedException
- initWithClass: (Class)class_







|
|












|
|







565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
@implementation OFReadFailedException
- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"Failed to read %zu bytes in class %@! " ERRFMT, requestedSize,
	    inClass, ERRPARAM];

	return description;
}
@end

@implementation OFWriteFailedException
- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"Failed to write %zu bytes in class %@! " ERRFMT, requestedSize,
	    inClass, ERRPARAM];

	return description;
}
@end

@implementation OFSeekFailedException
- initWithClass: (Class)class_
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621

- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"Seeking failed in class %s! " ERRFMT, class_getName(inClass),
	    ERRPARAM];

	return description;
}

- (int)errNo
{
	return errNo;







|
<







602
603
604
605
606
607
608
609

610
611
612
613
614
615
616

- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"Seeking failed in class %@! " ERRFMT, inClass, ERRPARAM];


	return description;
}

- (int)errNo
{
	return errNo;
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678

- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"Failed to create directory %@ in class %s! " ERRFMT, path,
	    class_getName(inClass), ERRPARAM];

	return description;
}

- (int)errNo
{
	return errNo;







|
|







658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673

- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"Failed to create directory %@ in class %@! " ERRFMT, path,
	    inClass, ERRPARAM];

	return description;
}

- (int)errNo
{
	return errNo;
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740

- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"Failed to change to directory %@ in class %s! " ERRFMT, path,
	    class_getName(inClass), ERRPARAM];

	return description;
}

- (int)errNo
{
	return errNo;







|
|







720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735

- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"Failed to change to directory %@ in class %@! " ERRFMT, path,
	    inClass, ERRPARAM];

	return description;
}

- (int)errNo
{
	return errNo;
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807

- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"Failed to change mode for file %@ to %d in class %s! " ERRFMT,
	    path, mode, class_getName(inClass), ERRPARAM];

	return description;
}

- (int)errNo
{
	return errNo;







|
|







787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802

- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"Failed to change mode for file %@ to %d in class %@! " ERRFMT,
	    path, mode, inClass, ERRPARAM];

	return description;
}

- (int)errNo
{
	return errNo;
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
- (OFString*)description
{
	if (description != nil)
		return description;

	if (group == nil)
		description = [[OFString alloc] initWithFormat:
		    @"Failed to change owner for file %@ to %@ in class %s! "
		    ERRFMT, path, owner, class_getName(inClass), ERRPARAM];
	else if (owner == nil)
		description = [[OFString alloc] initWithFormat:
		    @"Failed to change group for file %@ to %@ in class %s! "
		    ERRFMT, path, group, class_getName(inClass), ERRPARAM];
	else
		description = [[OFString alloc] initWithFormat:
		    @"Failed to change owner for file %@ to %@:%@ in class %s! "
		    ERRFMT, path, owner, group, class_getName(inClass),
		    ERRPARAM];

	return description;
}

- (int)errNo
{
	return errNo;







|
|


|
|


|
|
<







866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882

883
884
885
886
887
888
889
- (OFString*)description
{
	if (description != nil)
		return description;

	if (group == nil)
		description = [[OFString alloc] initWithFormat:
		    @"Failed to change owner for file %@ to %@ in class %@! "
		    ERRFMT, path, owner, inClass, ERRPARAM];
	else if (owner == nil)
		description = [[OFString alloc] initWithFormat:
		    @"Failed to change group for file %@ to %@ in class %@! "
		    ERRFMT, path, group, inClass, ERRPARAM];
	else
		description = [[OFString alloc] initWithFormat:
		    @"Failed to change owner for file %@ to %@:%@ in class %@! "
		    ERRFMT, path, owner, group, inClass, ERRPARAM];


	return description;
}

- (int)errNo
{
	return errNo;
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973

- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"Failed to copy file %@ to %@ in class %s! " ERRFMT,
	    sourcePath, destinationPath, class_getName(inClass), ERRPARAM];

	return description;
}

- (int)errNo
{
	return errNo;







|
|







952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967

- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"Failed to copy file %@ to %@ in class %@! " ERRFMT,
	    sourcePath, destinationPath, inClass, ERRPARAM];

	return description;
}

- (int)errNo
{
	return errNo;
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045

- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"Failed to rename file %@ to %@ in class %s! " ERRFMT, sourcePath,
	    destinationPath, class_getName(inClass), ERRPARAM];

	return description;
}

- (int)errNo
{
	return errNo;







|
|







1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039

- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"Failed to rename file %@ to %@ in class %@! " ERRFMT, sourcePath,
	    destinationPath, inClass, ERRPARAM];

	return description;
}

- (int)errNo
{
	return errNo;
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112

- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"Failed to delete file %@ in class %@! " ERRFMT, path,
	    class_getName(inClass), ERRPARAM];

	return description;
}

- (int)errNo
{
	return errNo;







|
|







1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106

- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"Failed to delete file %@ in class %@! " ERRFMT, path, inClass,
	    ERRPARAM];

	return description;
}

- (int)errNo
{
	return errNo;
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"Failed to delete directory %@ in class %@! " ERRFMT, path,
	    class_getName(inClass), ERRPARAM];

	return description;
}

- (int)errNo
{
	return errNo;







|







1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"Failed to delete directory %@ in class %@! " ERRFMT, path,
	    inClass, ERRPARAM];

	return description;
}

- (int)errNo
{
	return errNo;
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237

- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"Failed to link file %@ to %@ in class %s! " ERRFMT, sourcePath,
	    destinationPath, class_getName(inClass), ERRPARAM];

	return description;
}

- (int)errNo
{
	return errNo;







|
|







1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231

- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"Failed to link file %@ to %@ in class %@! " ERRFMT, sourcePath,
	    destinationPath, inClass, ERRPARAM];

	return description;
}

- (int)errNo
{
	return errNo;
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304

- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"Failed to symlink file %@ to %@ in class %s! " ERRFMT, sourcePath,
	    destinationPath, class_getName(inClass), ERRPARAM];

	return description;
}

- (int)errNo
{
	return errNo;







|
|







1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298

- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"Failed to symlink file %@ to %@ in class %@! " ERRFMT, sourcePath,
	    destinationPath, inClass, ERRPARAM];

	return description;
}

- (int)errNo
{
	return errNo;
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
@implementation OFSetOptionFailedException
- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"Setting an option in class %s failed!", class_getName(inClass)];

	return description;
}
@end

@implementation OFNotConnectedException
- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"The socket of type %s is not connected or bound!",
	    class_getName(inClass)];

	return description;
}
@end

@implementation OFAlreadyConnectedException
- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"The socket of type %s is already connected or bound and thus "
	    @"can't be connected or bound again!", class_getName(inClass)];

	return description;
}
@end

@implementation OFAddressTranslationFailedException
+ newWithClass: (Class)class_







|












|
<












|
|







1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333

1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
@implementation OFSetOptionFailedException
- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"Setting an option in class %@ failed!", inClass];

	return description;
}
@end

@implementation OFNotConnectedException
- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"The socket of type %@ is not connected or bound!", inClass];


	return description;
}
@end

@implementation OFAlreadyConnectedException
- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"The socket of type %@ is already connected or bound and thus "
	    @"can't be connected or bound again!", inClass];

	return description;
}
@end

@implementation OFAddressTranslationFailedException
+ newWithClass: (Class)class_
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
{
	if (description != nil)
		return description;

	if (host != nil)
		description = [[OFString alloc] initWithFormat:
		    @"The host %@ could not be translated to an address in "
		    @"class %s. This means that either the host was not found, "
		    @"there was a problem with the name server, there was a "
		    @"problem with your network connection or you specified an "
		    @"invalid host. " ERRFMT, host, class_getName(inClass),
		    AT_ERRPARAM];
	else
		description = [[OFString alloc] initWithFormat:
		    @"An address translation failed in class %s! " ERRFMT,
		    class_getName(inClass), AT_ERRPARAM];

	return description;
}

- (int)errNo
{
	return errNo;







|


|
<


|
|







1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404

1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
{
	if (description != nil)
		return description;

	if (host != nil)
		description = [[OFString alloc] initWithFormat:
		    @"The host %@ could not be translated to an address in "
		    @"class %@. This means that either the host was not found, "
		    @"there was a problem with the name server, there was a "
		    @"problem with your network connection or you specified an "
		    @"invalid host. " ERRFMT, host, inClass, AT_ERRPARAM];

	else
		description = [[OFString alloc] initWithFormat:
		    @"An address translation failed in class %@! " ERRFMT,
		    inClass, AT_ERRPARAM];

	return description;
}

- (int)errNo
{
	return errNo;
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"A connection to %@ on port %" @PRIu16 @"could not be established "
	    @"in class %s! " ERRFMT, host, port, class_getName(inClass),
	    ERRPARAM];

	return description;
}

- (int)errNo
{
	return errNo;







|
<







1467
1468
1469
1470
1471
1472
1473
1474

1475
1476
1477
1478
1479
1480
1481
- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"A connection to %@ on port %" @PRIu16 @"could not be established "
	    @"in class %@! " ERRFMT, host, port, inClass, ERRPARAM];


	return description;
}

- (int)errNo
{
	return errNo;
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561

- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"Binding to port %" @PRIu16 @" on host %@ failed in class %s! "
	    ERRFMT, port, host, class_getName(inClass), ERRPARAM];

	return description;
}

- (int)errNo
{
	return errNo;







|
|







1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552

- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"Binding to port %" @PRIu16 @" on host %@ failed in class %@! "
	    ERRFMT, port, host, inClass, ERRPARAM];

	return description;
}

- (int)errNo
{
	return errNo;
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616

- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"Failed to listen in socket of type %s with a back log of %d! "
	    ERRFMT, class_getName(inClass), backLog, ERRPARAM];

	return description;
}

- (int)errNo
{
	return errNo;







|
|







1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607

- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"Failed to listen in socket of type %@ with a back log of %d! "
	    ERRFMT, inClass, backLog, ERRPARAM];

	return description;
}

- (int)errNo
{
	return errNo;
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736

- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"Failed to accept connection in socket of type %s! " ERRFMT,
	    class_getName(inClass), ERRPARAM];

	return description;
}

- (int)errNo
{
	return errNo;
}
@end

@implementation OFThreadStartFailedException
- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"Starting a thread of class %s failed!", class_getName(inClass)];

	return description;
}
@end

@implementation OFThreadJoinFailedException
- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"Joining a thread of class %s failed! Most likely, another thread "
	    @"already waits for the thread to join.", class_getName(inClass)];

	return description;
}
@end

@implementation OFThreadStillRunningException
- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"Deallocation of a thread of type %s was tried, even though it "
	    @"was still running", class_getName(inClass)];

	return description;
}
@end

@implementation OFMutexLockFailedException
- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"A mutex could not be locked in class %s", class_getName(inClass)];

	return description;
}
@end

@implementation OFMutexUnlockFailedException
- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"A mutex could not be unlocked in class %s",
	    class_getName(inClass)];

	return description;
}
@end

@implementation OFHashAlreadyCalculatedException
- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"The hash has already been calculated in class %s and thus no new "
	    @"data can be added", class_getName(inClass)];

	return description;
}
@end

@implementation OFUnboundNamespaceException
+ newWithClass: (Class)class_







|
|

















|












|
|












|
|












|












|
<












|
|







1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705

1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726

- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"Failed to accept connection in socket of type %@! " ERRFMT,
	    inClass, ERRPARAM];

	return description;
}

- (int)errNo
{
	return errNo;
}
@end

@implementation OFThreadStartFailedException
- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"Starting a thread of class %@ failed!", inClass];

	return description;
}
@end

@implementation OFThreadJoinFailedException
- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"Joining a thread of class %@ failed! Most likely, another thread "
	    @"already waits for the thread to join.", inClass];

	return description;
}
@end

@implementation OFThreadStillRunningException
- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"Deallocation of a thread of type %@ was tried, even though it "
	    @"was still running", inClass];

	return description;
}
@end

@implementation OFMutexLockFailedException
- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"A mutex could not be locked in class %@", inClass];

	return description;
}
@end

@implementation OFMutexUnlockFailedException
- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"A mutex could not be unlocked in class %@", inClass];


	return description;
}
@end

@implementation OFHashAlreadyCalculatedException
- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"The hash has already been calculated in class %@ and thus no new "
	    @"data can be added", inClass];

	return description;
}
@end

@implementation OFUnboundNamespaceException
+ newWithClass: (Class)class_
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
- (OFString*)description
{
	if (description != nil)
		return description;

	if (ns != nil)
		description = [[OFString alloc] initWithFormat:
		    @"The namespace %@ is not bound in class %s", ns,
		    class_getName(inClass)];
	else if (prefix != nil)
		description = [[OFString alloc] initWithFormat:
		    @"The prefix %@ is not bound to any namespace in %s",
		    prefix, class_getName(inClass)];

	return description;
}

- (OFString*)namespace
{
	return ns;







|
<


|
|







1786
1787
1788
1789
1790
1791
1792
1793

1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
- (OFString*)description
{
	if (description != nil)
		return description;

	if (ns != nil)
		description = [[OFString alloc] initWithFormat:
		    @"The namespace %@ is not bound in class %@", ns, inClass];

	else if (prefix != nil)
		description = [[OFString alloc] initWithFormat:
		    @"The prefix %@ is not bound to any namespace in class %@",
		    prefix, inClass];

	return description;
}

- (OFString*)namespace
{
	return ns;
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895

- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"The protocol of URL %@ is not supported by class %s", URL,
	    class_getName(inClass)];

	return description;
}

- (OFURL*)URL
{
	return URL;
}
@end

@implementation OFInvalidServerReplyException
- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"Got an invalid reply from the server in class %s",
	    class_getName(inClass)];

	return description;
}
@end

@implementation OFHTTPRequestFailedException
+ newWithClass: (Class)class_







|
|

















|
<







1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876

1877
1878
1879
1880
1881
1882
1883

- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"The protocol of URL %@ is not supported by class %@", URL,
	    inClass];

	return description;
}

- (OFURL*)URL
{
	return URL;
}
@end

@implementation OFInvalidServerReplyException
- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"Got an invalid reply from the server in class %@", inClass];


	return description;
}
@end

@implementation OFHTTPRequestFailedException
+ newWithClass: (Class)class_
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
		type = "POST";
		break;
	}

	pool = [[OFAutoreleasePool alloc] init];

	description = [[OFString alloc] initWithFormat:
	    @"A HTTP %s request of class %s with URL %@ failed with code %d",
	    type, class_getName(inClass), [HTTPRequest URL], statusCode];

	[pool release];

	return description;
}

- (OFHTTPRequest*)HTTPRequest







|
|







1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
		type = "POST";
		break;
	}

	pool = [[OFAutoreleasePool alloc] init];

	description = [[OFString alloc] initWithFormat:
	    @"A HTTP %s request in class %@ with URL %@ failed with code %d",
	    type, inClass, [HTTPRequest URL], statusCode];

	[pool release];

	return description;
}

- (OFHTTPRequest*)HTTPRequest
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
@implementation OFTruncatedDataException
- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"Truncated data was received or produced in class %s while it "
	    @"should not have been truncated!", class_getName(inClass)];

	return description;
}
@end







|
|




1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
@implementation OFTruncatedDataException
- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"Truncated data was received or produced in class %@ while it "
	    @"should not have been truncated!", inClass];

	return description;
}
@end