ObjFW  Diff

Differences From Artifact [466d9af03d]:

To Artifact [c534072540]:


27
28
29
30
31
32
33

34
35
36
37
38
39
40
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41







+







# import "OFFile.h"
# import "OFFileManager.h"
#endif
#import "OFIRI.h"
#import "OFIRIHandler.h"
#import "OFStream.h"
#import "OFString.h"
#import "OFSubdata.h"
#import "OFSystemInfo.h"

#import "OFInvalidArgumentException.h"
#import "OFInvalidFormatException.h"
#import "OFNotImplementedException.h"
#import "OFOutOfMemoryException.h"
#import "OFOutOfRangeException.h"
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
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







-
-




+
+
+
-
+

-
-
-
+
+
+







	OFHashFinalize(&hash);

	return hash;
}

- (OFData *)subdataWithRange: (OFRange)range
{
	size_t itemSize;

	if (range.length > SIZE_MAX - range.location ||
	    range.location + range.length > self.count)
		@throw [OFOutOfRangeException exception];

	if (![self isKindOfClass: [OFMutableData class]])
		return [[[OFSubdata alloc] initWithData: self
						  range: range] autorelease];
	itemSize = self.itemSize;

	return [OFData dataWithItems: (const unsigned char *)self.items +
				      (range.location * itemSize)
			       count: range.length
			    itemSize: itemSize];
				      (range.location * self.itemSize)
			       count: self.count
			    itemSize: self.itemSize];
}

- (OFString *)description
{
	OFMutableString *ret = [OFMutableString stringWithString: @"<"];
	const unsigned char *items = self.items;
	size_t count = self.count, itemSize = self.itemSize;