ObjFW  Diff

Differences From Artifact [26a733beee]:

To Artifact [bb672c63ef]:


1
2
3
4
5
6
7
8
9
10
11
12
13

14
15
16
17
18
19
20
/*
 * Copyright (c) 2008 - 2009
 *   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.
 */

#import "OFObject.h"
#import "OFString.h"


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













>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*
 * Copyright (c) 2008 - 2009
 *   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.
 */

#import "OFObject.h"
#import "OFString.h"
#import "OFFile.h"

/**
 * 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.
351
352
353
354
355
356
357
































































































































































































358
359
360
361
362
363
364

/**
 * An OFException indicating a write to the file failed.
 */
@interface OFWriteFailedException: OFReadOrWriteFailedException {}
@end

































































































































































































/**
 * An OFException indicating that creating a link failed.
 */
@interface OFLinkFailedException: OFException
{
	OFString *src;
	OFString *dest;







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







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
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
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557

/**
 * An OFException indicating a write to the file failed.
 */
@interface OFWriteFailedException: OFReadOrWriteFailedException {}
@end

/**
 * An OFException indicating that changing the mode of the 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
 */
+ newWithClass: (Class)class_
	  path: (OFString*)path
	  mode: (mode_t)mode;

/**
 * Initializes an already allocated change file mode failed exception.
 *
 * \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
 */
- initWithClass: (Class)class_
	   path: (OFString*)path
	   mode: (mode_t)mode;

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

/**
 * \return The path of the file
 */
- (OFString*)path;

/**
 * \return The new mode for the file
 */
- (mode_t)mode;
@end

/**
 * An OFException indicating that changing the owner of the 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
 * \return An initialized change file owner failed exception
 */
+ newWithClass: (Class)class_
	  path: (OFString*)path
	 owner: (uid_t)owner
	 group: (gid_t)group;

/**
 * Initializes an already allocated change file owner failed exception.
 *
 * \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
 * \return An initialized change file owner failed exception
 */
- initWithClass: (Class)class_
	   path: (OFString*)path
	  owner: (uid_t)owner
	  group: (gid_t)group;

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

/**
 * \return The path of the file
 */
- (OFString*)path;

/**
 * \return The new owner for the file
 */
- (uid_t)owner;

/**
 * \return The new group for the file
 */
- (gid_t)group;
@end

/**
 * An OFException indicating that renaming a file failed.
 */
@interface OFRenameFileFailedException: OFException
{
	OFString *from;
	OFString *to;
	int err;
}

/**
 * \param class_ The class of the object which caused the exception
 * \param from The original path
 * \param to The new path
 * \return A new rename file failed exception
 */
+ newWithClass: (Class)class_
	  from: (OFString*)from
	    to: (OFString*)to;

/**
 * Initializes an already allocated rename failed exception.
 *
 * \param class_ The class of the object which caused the exception
 * \param from The original path
 * \param to The new path
 * \return An initialized rename file failed exception
 */
- initWithClass: (Class)class_
	   from: (OFString*)from
	     to: (OFString*)to;

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

/**
 * \return The original path
 */
- (OFString*)from;

/**
 * \return The new path
 */
- (OFString*)to;
@end

/**
 * An OFException 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
 */
+ newWithClass: (Class)class_
	  path: (OFString*)path;

/**
 * Initializes an already allocated delete file failed exception.
 *
 * \param class_ The class of the object which caused the exception
 * \param path The path of the file
 * \return An initialized delete file failed exception
 */
- initWithClass: (Class)class_
	   path: (OFString*)path;

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

/**
 * \return The path of the file
 */
- (OFString*)path;
@end

/**
 * An OFException indicating that creating a link failed.
 */
@interface OFLinkFailedException: OFException
{
	OFString *src;
	OFString *dest;
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
 * \return A new link failed exception
 */
+ newWithClass: (Class)class_
	source: (OFString*)src
   destination: (OFString*)dest;

/**
 * Initializes an already allocated open file failed exception.
 *
 * \param class_ The class of the object which caused the exception
 * \param source The source for the link
 * \param destination The destination for the link
 * \return An initialized link failed exception
 */
- initWithClass: (Class)class_







|







565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
 * \return A new link failed exception
 */
+ newWithClass: (Class)class_
	source: (OFString*)src
   destination: (OFString*)dest;

/**
 * Initializes an already allocated link failed exception.
 *
 * \param class_ The class of the object which caused the exception
 * \param source The source for the link
 * \param destination The destination for the link
 * \return An initialized link failed exception
 */
- initWithClass: (Class)class_
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
 * \return A new symlink failed exception
 */
+ newWithClass: (Class)class_
	source: (OFString*)src
   destination: (OFString*)dest;

/**
 * Initializes an already allocated open file failed exception.
 *
 * \param class_ The class of the object which caused the exception
 * \param source The source for the symlink
 * \param destination The destination for the symlink
 * \return An initialized symlink failed exception
 */
- initWithClass: (Class)class_







|







613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
 * \return A new symlink failed exception
 */
+ newWithClass: (Class)class_
	source: (OFString*)src
   destination: (OFString*)dest;

/**
 * Initializes an already allocated symlink failed exception.
 *
 * \param class_ The class of the object which caused the exception
 * \param source The source for the symlink
 * \param destination The destination for the symlink
 * \return An initialized symlink failed exception
 */
- initWithClass: (Class)class_