ObjFW  Diff

Differences From Artifact [f159950386]:

To Artifact [db844d6204]:


333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
@end

@implementation OFOpenFileFailedException
+ newWithClass: (Class)class__
	  path: (OFString*)path_
	  mode: (OFString*)mode_
{
	return [[self alloc] initWithClass: class__
				      path: path_
				      mode: mode_];
}

- initWithClass: (Class)class__
{
	@throw [OFNotImplementedException newWithClass: isa
					      selector: _cmd];
}







|
|
|







333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
@end

@implementation OFOpenFileFailedException
+ newWithClass: (Class)class__
	  path: (OFString*)path_
	  mode: (OFString*)mode_
{
	return [(OFOpenFileFailedException*)[self alloc] initWithClass: class__
								  path: path_
								  mode: mode_];
}

- initWithClass: (Class)class__
{
	@throw [OFNotImplementedException newWithClass: isa
					      selector: _cmd];
}
509
510
511
512
513
514
515


































































































































































































































































516
517
518
519
520
521
522
		string = [[OFString alloc] initWithFormat:
		    @"Failed to write %zu bytes in class %s! " ERRFMT, req_size,
		    [class_ className], ERRPARAM];

	return string;
}
@end



































































































































































































































































@implementation OFLinkFailedException
+ newWithClass: (Class)class__
	source: (OFString*)src_
   destination: (OFString*)dest_
{
	return [[self alloc] initWithClass: class__







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







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
558
559
560
561
562
563
564
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
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
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
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
		string = [[OFString alloc] initWithFormat:
		    @"Failed to write %zu bytes in class %s! " ERRFMT, req_size,
		    [class_ className], ERRPARAM];

	return string;
}
@end

@implementation OFChangeFileModeFailedException
+ newWithClass: (Class)class__
	  path: (OFString*)path_
	  mode: (mode_t)mode_
{
	return [(OFChangeFileModeFailedException*)[self alloc]
	    initWithClass: class__
		     path: path_
		     mode: mode_];
}

- initWithClass: (Class)class__
{
	@throw [OFNotImplementedException newWithClass: isa
					      selector: _cmd];
}

- initWithClass: (Class)class__
	   path: (OFString*)path_
	   mode: (mode_t)mode_
{
	self = [super initWithClass: class__];

	path = [path_ copy];
	mode = mode_;
	err  = GET_ERR;

	return self;
}

- (void)dealloc
{
	[path release];

	[super dealloc];
}

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

	string = [[OFString alloc] initWithFormat:
	    @"Failed to change mode for file %s to %d in class %s! " ERRFMT,
	    [path cString], mode, [class_ className], ERRPARAM];

	return string;
}

- (int)errNo
{
	return err;
}

- (OFString*)path
{
	return path;
}

- (mode_t)mode
{
	return mode;
}
@end

@implementation OFChangeFileOwnerFailedException
+ newWithClass: (Class)class__
	  path: (OFString*)path_
	 owner: (uid_t)owner_
	 group: (gid_t)group_
{
	return [[self alloc] initWithClass: class__
				      path: path_
				     owner: owner_
				     group: group_];
}

- initWithClass: (Class)class__
{
	@throw [OFNotImplementedException newWithClass: isa
					      selector: _cmd];
}

- initWithClass: (Class)class__
	   path: (OFString*)path_
	  owner: (uid_t)owner_
	  group: (gid_t)group_
{
	self = [super initWithClass: class__];

	path  = [path_ copy];
	owner = owner_;
	group = group_;
	err   = GET_ERR;

	return self;
}

- (void)dealloc
{
	[path release];

	[super dealloc];
}

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

	string = [[OFString alloc] initWithFormat:
	    @"Failed to change owner for file %s to %d:%d in class %s! " ERRFMT,
	    [path cString], owner, group, [class_ className], ERRPARAM];

	return string;
}

- (int)errNo
{
	return err;
}

- (OFString*)path
{
	return path;
}

- (uid_t)owner
{
	return owner;
}

- (gid_t)group
{
	return group;
}
@end

@implementation OFRenameFileFailedException
+ newWithClass: (Class)class__
	  from: (OFString*)from_
	    to: (OFString*)to_
{
	return [[self alloc] initWithClass: class__
				      from: from_
					to: to_];
}

- initWithClass: (Class)class__
{
	@throw [OFNotImplementedException newWithClass: isa
					      selector: _cmd];
}

- initWithClass: (Class)class__
	   from: (OFString*)from_
	     to: (OFString*)to_
{
	self = [super initWithClass: class__];

	from = [from_ copy];
	to   = [to_ copy];
	err  = GET_ERR;

	return self;
}

- (void)dealloc
{
	[from release];
	[to release];

	[super dealloc];
}

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

	string = [[OFString alloc] initWithFormat:
	    @"Failed to rename file %s to %s in class %s! " ERRFMT,
	    [from cString], [to cString], [class_ className], ERRPARAM];

	return string;
}

- (int)errNo
{
	return err;
}

- (OFString*)from
{
	return from;
}

- (OFString*)to
{
	return to;
}
@end

@implementation OFDeleteFileFailedException
+ newWithClass: (Class)class__
	  path: (OFString*)path_
{
	return [[self alloc] initWithClass: class__
				      path: path_];
}

- initWithClass: (Class)class__
{
	@throw [OFNotImplementedException newWithClass: isa
					      selector: _cmd];
}

- initWithClass: (Class)class__
	   path: (OFString*)path_
{
	self = [super initWithClass: class__];

	path = [path_ copy];
	err  = GET_ERR;

	return self;
}

- (void)dealloc
{
	[path release];

	[super dealloc];
}

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

	string = [[OFString alloc] initWithFormat:
	    @"Failed to delete file %s in class %s! " ERRFMT, [path cString],
	    [class_ className], ERRPARAM];

	return string;
}

- (int)errNo
{
	return err;
}

- (OFString*)path
{
	return path;
}
@end

@implementation OFLinkFailedException
+ newWithClass: (Class)class__
	source: (OFString*)src_
   destination: (OFString*)dest_
{
	return [[self alloc] initWithClass: class__