ObjFW  Diff

Differences From Artifact [df33921628]:

To Artifact [993787fe25]:


23
24
25
26
27
28
29

30
31
32
33
34
35
36
37

38
39
40
41
42
43
44
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46







+








+







#import "OFDataArray.h"
#import "OFString.h"
#import "OFFile.h"
#import "OFURL.h"
#import "OFHTTPClient.h"
#import "OFHTTPRequest.h"
#import "OFHTTPRequestReply.h"
#import "OFDictionary.h"
#import "OFXMLElement.h"
#import "OFSystemInfo.h"

#import "OFHTTPRequestFailedException.h"
#import "OFInvalidArgumentException.h"
#import "OFInvalidFormatException.h"
#import "OFOutOfMemoryException.h"
#import "OFOutOfRangeException.h"
#import "OFTruncatedDataException.h"

#import "autorelease.h"
#import "base64.h"
#import "macros.h"

/* References for static linking */
void _references_to_categories_of_OFDataArray(void)
140
141
142
143
144
145
146


147
148
149
150
151
152
153
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157







+
+








- initWithContentsOfURL: (OFURL*)URL
{
	void *pool;
	OFHTTPClient *client;
	OFHTTPRequest *request;
	OFHTTPRequestReply *reply;
	OFDictionary *headers;
	OFString *contentLength;
	Class c;

	c = [self class];
	[self release];

	pool = objc_autoreleasePoolPush();

163
164
165
166
167
168
169
170








171

172
173
174
175
176
177
178
167
168
169
170
171
172
173

174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190







-
+
+
+
+
+
+
+
+

+








	if ([reply statusCode] != 200)
		@throw [OFHTTPRequestFailedException
		    exceptionWithClass: [request class]
			       request: request
				 reply: reply];

	self = [[reply data] retain];
	self = [[reply readDataArrayTillEndOfStream] retain];

	headers = [reply headers];
	if ((contentLength = [headers objectForKey: @"Content-Length"]) != nil)
		if ([self count] != (size_t)[contentLength decimalValue])
			@throw [OFTruncatedDataException
			    exceptionWithClass: [self class]];

	objc_autoreleasePoolPop(pool);

	return self;
}

- initWithStringRepresentation: (OFString*)string
{
	self = [super init];