ObjFW  Diff

Differences From Artifact [62af6f1338]:

To Artifact [cb54da3d31]:


163
164
165
166
167
168
169
170


171
172
173
174
175
176
177

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

	itemSize = 1;

	if (!of_base64_decode(self, [string cString], [string cStringLength])) {


		Class c = isa;
		[self release];
		@throw [OFInvalidEncodingException newWithClass: c];
	}

	return self;
}







|
>
>







163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179

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

	itemSize = 1;

	if (!of_base64_decode(self,
	    [string cStringWithEncoding: OF_STRING_ENCODING_ASCII],
	    [string cStringLengthWithEncoding: OF_STRING_ENCODING_ASCII])) {
		Class c = isa;
		[self release];
		@throw [OFInvalidEncodingException newWithClass: c];
	}

	return self;
}
189
190
191
192
193
194
195
196

197

198
199
200
201
202
203
204
		if (![[element name] isEqual: [self className]] ||
		    ![[element namespace] isEqual: OF_SERIALIZATION_NS])
			@throw [OFInvalidArgumentException newWithClass: isa
							       selector: _cmd];

		stringValue = [element stringValue];

		if (!of_base64_decode(self, [stringValue cString],

		    [stringValue cStringLength]))

			@throw [OFInvalidEncodingException newWithClass: isa];

		[pool release];
	} @catch (id e) {
		[self release];
		@throw e;
	}







|
>
|
>







191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
		if (![[element name] isEqual: [self className]] ||
		    ![[element namespace] isEqual: OF_SERIALIZATION_NS])
			@throw [OFInvalidArgumentException newWithClass: isa
							       selector: _cmd];

		stringValue = [element stringValue];

		if (!of_base64_decode(self,
		    [stringValue cStringWithEncoding: OF_STRING_ENCODING_ASCII],
		    [stringValue cStringLengthWithEncoding:
		    OF_STRING_ENCODING_ASCII]))
			@throw [OFInvalidEncodingException newWithClass: isa];

		[pool release];
	} @catch (id e) {
		[self release];
		@throw e;
	}