ObjFW  Diff

Differences From Artifact [4dc9cb934e]:

To Artifact [1f60c6d11f]:


50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
	Class isa;
} placeholder;

@interface OFPlaceholderData: OFString
@end

/* References for static linking */
void
_references_to_categories_of_OFData(void)
{
	_OFData_CryptographicHashing_reference = 1;
	_OFData_MessagePackParsing_reference = 1;
}

@implementation OFPlaceholderData







|







50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
	Class isa;
} placeholder;

@interface OFPlaceholderData: OFString
@end

/* References for static linking */
void OF_VISIBILITY_HIDDEN
_references_to_categories_of_OFData(void)
{
	_OFData_CryptographicHashing_reference = 1;
	_OFData_MessagePackParsing_reference = 1;
}

@implementation OFPlaceholderData
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
{
	void *pool = objc_autoreleasePoolPush();
	OFMutableData *data;

	@try {
		data = [OFMutableData data];

		if (!OFBase64Decode(data,
		    [string cStringWithEncoding: OFStringEncodingASCII],
		    [string cStringLengthWithEncoding: OFStringEncodingASCII]))
			@throw [OFInvalidFormatException exception];
	} @catch (id e) {
		[self release];
		@throw e;
	}







|







401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
{
	void *pool = objc_autoreleasePoolPush();
	OFMutableData *data;

	@try {
		data = [OFMutableData data];

		if (!_OFBase64Decode(data,
		    [string cStringWithEncoding: OFStringEncodingASCII],
		    [string cStringLengthWithEncoding: OFStringEncodingASCII]))
			@throw [OFInvalidFormatException exception];
	} @catch (id e) {
		[self release];
		@throw e;
	}
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635

	[ret makeImmutable];
	return ret;
}

- (OFString *)stringByBase64Encoding
{
	return OFBase64Encode(self.items, self.count * self.itemSize);
}

- (OFRange)rangeOfData: (OFData *)data
	       options: (OFDataSearchOptions)options
		 range: (OFRange)range
{
	const unsigned char *items = self.items;







|







621
622
623
624
625
626
627
628
629
630
631
632
633
634
635

	[ret makeImmutable];
	return ret;
}

- (OFString *)stringByBase64Encoding
{
	return _OFBase64Encode(self.items, self.count * self.itemSize);
}

- (OFRange)rangeOfData: (OFData *)data
	       options: (OFDataSearchOptions)options
		 range: (OFRange)range
{
	const unsigned char *items = self.items;