ObjFW  Diff

Differences From Artifact [f8a53f2bce]:

To Artifact [6329d53dc9]:


47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
 * 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_;
	OFString *string;
}

/**
 * Creates a new exception.
 *
 * \param class_ The class of the object which caused the exception







|







47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
 * 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 inClass;
	OFString *string;
}

/**
 * Creates a new exception.
 *
 * \param class_ The class of the object which caused the exception
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
@end

/**
 * \brief An exception indicating there is not enough memory available.
 */
@interface OFOutOfMemoryException: OFException
{
	size_t req_size;
}

/**
 * \param class_ The class of the object which caused the exception
 * \param size The size of the memory that couldn't be allocated
 * \return A new no memory exception
 */







|







83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
@end

/**
 * \brief An exception indicating there is not enough memory available.
 */
@interface OFOutOfMemoryException: OFException
{
	size_t requestedSize;
}

/**
 * \param class_ The class of the object which caused the exception
 * \param size The size of the memory that couldn't be allocated
 * \return A new no memory exception
 */
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
/**
 * \brief An exception indicating a file couldn't be opened.
 */
@interface OFOpenFileFailedException: OFException
{
	OFString *path;
	OFString *mode;
	int err;
}

/**
 * \param class_ The class of the object which caused the exception
 * \param path A string with the path of the file tried to open
 * \param mode A string with the mode in which the file should have been opened
 * \return A new open file failed exception







|







242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
/**
 * \brief An exception indicating a file couldn't be opened.
 */
@interface OFOpenFileFailedException: OFException
{
	OFString *path;
	OFString *mode;
	int errNo;
}

/**
 * \param class_ The class of the object which caused the exception
 * \param path A string with the path of the file tried to open
 * \param mode A string with the mode in which the file should have been opened
 * \return A new open file failed exception
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
@end

/**
 * \brief An exception indicating a read or write to a stream failed.
 */
@interface OFReadOrWriteFailedException: OFException
{
	size_t req_size;
	int    err;
}

/**
 * \param class_ The class of the object which caused the exception
 * \param size The requested size of the data that couldn't be read / written
 * \return A new open file failed exception
 */







|
|







288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
@end

/**
 * \brief An exception indicating a read or write to a stream failed.
 */
@interface OFReadOrWriteFailedException: OFException
{
	size_t requestedSize;
	int    errNo;
}

/**
 * \param class_ The class of the object which caused the exception
 * \param size The requested size of the data that couldn't be read / written
 * \return A new open file failed exception
 */
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
@end

/**
 * \brief An exception indicating that seeking in a stream failed.
 */
@interface OFSeekFailedException: OFException
{
	int err;
}

/**
 * \return The errno from when the exception was created
 */
- (int)errNo;
@end

/**
 * \brief An exception indicating a directory couldn't be created.
 */
@interface OFCreateDirectoryFailedException: OFException
{
	OFString *path;
	int err;
}

/**
 * \param class_ The class of the object which caused the exception
 * \param path A string with the path of the directory which couldn't be created
 * \return A new create directory failed exception
 */







|














|







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

/**
 * \brief An exception indicating that seeking in a stream failed.
 */
@interface OFSeekFailedException: OFException
{
	int errNo;
}

/**
 * \return The errno from when the exception was created
 */
- (int)errNo;
@end

/**
 * \brief An exception indicating a directory couldn't be created.
 */
@interface OFCreateDirectoryFailedException: OFException
{
	OFString *path;
	int errNo;
}

/**
 * \param class_ The class of the object which caused the exception
 * \param path A string with the path of the directory which couldn't be created
 * \return A new create directory failed exception
 */
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
/**
 * \brief An exception indicating that changing the mode of a file failed.
 */
@interface OFChangeFileModeFailedException: OFException
{
	OFString *path;
	mode_t mode;
	int err;
}

/**
 * \param class_ The class of the object which caused the exception
 * \param path The path of the file
 * \param mode The new mode for the file
 * \return An initialized change file mode failed exception







|







392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
/**
 * \brief An exception indicating that changing the mode of a file failed.
 */
@interface OFChangeFileModeFailedException: OFException
{
	OFString *path;
	mode_t mode;
	int errNo;
}

/**
 * \param class_ The class of the object which caused the exception
 * \param path The path of the file
 * \param mode The new mode for the file
 * \return An initialized change file mode failed exception
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
 * \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;
}

/**
 * \param class_ The class of the object which caused the exception
 * \param path The path of the file
 * \param owner The new owner for the file
 * \param group The new group for the file







|







442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
 * \brief An exception indicating that changing the owner of a file failed.
 */
@interface OFChangeFileOwnerFailedException: OFException
{
	OFString *path;
	uid_t owner;
	gid_t group;
	int errNo;
}

/**
 * \param class_ The class of the object which caused the exception
 * \param path The path of the file
 * \param owner The new owner for the file
 * \param group The new group for the file
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
#endif

/**
 * \brief An exception indicating that renaming a file failed.
 */
@interface OFRenameFileFailedException: OFException
{
	OFString *src;
	OFString *dst;
	int err;
}

/**
 * \param class_ The class of the object which caused the exception
 * \param src The original path
 * \param dst The new path
 * \return A new rename file failed exception







|
|
|







498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
#endif

/**
 * \brief An exception indicating that renaming a file failed.
 */
@interface OFRenameFileFailedException: OFException
{
	OFString *sourcePath;
	OFString *destinationPath;
	int errNo;
}

/**
 * \param class_ The class of the object which caused the exception
 * \param src The original path
 * \param dst The new path
 * \return A new rename file failed exception
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561

/**
 * \brief An exception indicating that deleting a file failed.
 */
@interface OFDeleteFileFailedException: OFException
{
	OFString *path;
	int err;
}

/**
 * \param class_ The class of the object which caused the exception
 * \param path The path of the file
 * \return A new delete file failed exception
 */







|







547
548
549
550
551
552
553
554
555
556
557
558
559
560
561

/**
 * \brief An exception indicating that deleting a file failed.
 */
@interface OFDeleteFileFailedException: OFException
{
	OFString *path;
	int errNo;
}

/**
 * \param class_ The class of the object which caused the exception
 * \param path The path of the file
 * \return A new delete file failed exception
 */
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601

#ifndef _WIN32
/**
 * \brief An exception indicating that creating a link failed.
 */
@interface OFLinkFailedException: OFException
{
	OFString *src;
	OFString *dest;
	int err;
}

/**
 * \param class_ The class of the object which caused the exception
 * \param src The source for the link
 * \param dest The destination for the link
 * \return A new link failed exception







|
|
|







585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601

#ifndef _WIN32
/**
 * \brief An exception indicating that creating a link failed.
 */
@interface OFLinkFailedException: OFException
{
	OFString *sourcePath;
	OFString *destinationPath;
	int errNo;
}

/**
 * \param class_ The class of the object which caused the exception
 * \param src The source for the link
 * \param dest The destination for the link
 * \return A new link failed exception
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
@end

/**
 * \brief An exception indicating that creating a symlink failed.
 */
@interface OFSymlinkFailedException: OFException
{
	OFString *src;
	OFString *dest;
	int err;
}

/**
 * \param class_ The class of the object which caused the exception
 * \param src The source for the symlink
 * \param dest The destination for the symlink
 * \return A new symlink failed exception







|
|
|







633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
@end

/**
 * \brief An exception indicating that creating a symlink failed.
 */
@interface OFSymlinkFailedException: OFException
{
	OFString *sourcePath;
	OFString *destinationPath;
	int errNo;
}

/**
 * \param class_ The class of the object which caused the exception
 * \param src The source for the symlink
 * \param dest The destination for the symlink
 * \return A new symlink failed exception
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
/**
 * \brief An exception indicating the translation of an address failed.
 */
@interface OFAddressTranslationFailedException: OFException
{
	OFString *node;
	OFString *service;
	int	 err;
}

/**
 * \param class_ The class of the object which caused the exception
 * \param node The node for which translation was requested
 * \param service The service of the node for which translation was requested
 * \return A new address translation failed exception







|







703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
/**
 * \brief An exception indicating the translation of an address failed.
 */
@interface OFAddressTranslationFailedException: OFException
{
	OFString *node;
	OFString *service;
	int	 errNo;
}

/**
 * \param class_ The class of the object which caused the exception
 * \param node The node for which translation was requested
 * \param service The service of the node for which translation was requested
 * \return A new address translation failed exception
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
/**
 * \brief An exception indicating that a connection could not be established.
 */
@interface OFConnectionFailedException: OFException
{
	OFString *node;
	OFString *service;
	int	 err;
}

/**
 * \param class_ The class of the object which caused the exception
 * \param node The node to which the connection failed
 * \param service The service on the node to which the connection failed
 * \return A new connection failed exception







|







751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
/**
 * \brief An exception indicating that a connection could not be established.
 */
@interface OFConnectionFailedException: OFException
{
	OFString *node;
	OFString *service;
	int	 errNo;
}

/**
 * \param class_ The class of the object which caused the exception
 * \param node The node to which the connection failed
 * \param service The service on the node to which the connection failed
 * \return A new connection failed exception
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
 * \brief An exception indicating that binding a socket failed.
 */
@interface OFBindFailedException: OFException
{
	OFString *node;
	OFString *service;
	int	 family;
	int	 err;
}

/**
 * \param class_ The class of the object which caused the exception
 * \param node The node on which binding failed
 * \param service The service on which binding failed
 * \param family The family for which binnding failed







|







800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
 * \brief An exception indicating that binding a socket failed.
 */
@interface OFBindFailedException: OFException
{
	OFString *node;
	OFString *service;
	int	 family;
	int	 errNo;
}

/**
 * \param class_ The class of the object which caused the exception
 * \param node The node on which binding failed
 * \param service The service on which binding failed
 * \param family The family for which binnding failed
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
@end

/**
 * \brief An exception indicating that listening on the socket failed.
 */
@interface OFListenFailedException: OFException
{
	int backlog;
	int err;
}

/**
 * \param class_ The class of the object which caused the exception
 * \param backlog The requested size of the back log
 * \return A new listen failed exception
 */







|
|







855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
@end

/**
 * \brief An exception indicating that listening on the socket failed.
 */
@interface OFListenFailedException: OFException
{
	int backLog;
	int errNo;
}

/**
 * \param class_ The class of the object which caused the exception
 * \param backlog The requested size of the back log
 * \return A new listen failed exception
 */
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
@end

/**
 * \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







|







893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
@end

/**
 * \brief An exception indicating that accepting a connection failed.
 */
@interface OFAcceptFailedException: OFException
{
	int errNo;
}

/**
 * \return The errno from when the exception was created
 */
- (int)errNo;
@end