ObjFW  Diff

Differences From Artifact [83b3387d68]:

To Artifact [e46fcb96eb]:


285
286
287
288
289
290
291
292
293


294
295
296
297
298
299
300
301
302
285
286
287
288
289
290
291


292
293


294
295
296
297
298
299
300







-
-
+
+
-
-







}

- initWithSerialization: (OFXMLElement*)element
{
	@try {
		OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];

		if (![[element name] isEqual: @"object"] ||
		    ![[element namespace] isEqual: OF_SERIALIZATION_NS] ||
		if (![[element name] isEqual: [self className]] ||
		    ![[element namespace] isEqual: OF_SERIALIZATION_NS])
		    ![[[element attributeForName: @"class"] stringValue]
		    isEqual: [self className]])
			@throw [OFInvalidArgumentException newWithClass: isa
							       selector: _cmd];

		self = [self initWithString: [element stringValue]];

		[pool release];
	} @catch (id e) {
546
547
548
549
550
551
552
553

554
555
556
557
558



559
560
561
562
563
564






565
566
567
568
569
544
545
546
547
548
549
550

551
552
553



554
555
556

557




558
559
560
561
562
563

564
565
566
567







-
+


-
-
-
+
+
+
-

-
-
-
-
+
+
+
+
+
+
-




- (OFString*)description
{
	return [self string];
}

- (OFXMLElement*)XMLElementBySerializing
{
	OFAutoreleasePool *pool;
	OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
	OFXMLElement *element;

	element = [OFXMLElement elementWithName: @"object"
				      namespace: OF_SERIALIZATION_NS];

	element = [OFXMLElement elementWithName: [self className]
				      namespace: OF_SERIALIZATION_NS
				    stringValue: [self string]];
	pool = [[OFAutoreleasePool alloc] init];

	[element addAttributeWithName: @"class"
			  stringValue: [self className]];
	[element setStringValue: [self string]];

	[element retain];
	@try {
		[pool release];
	} @finally {
		[element autorelease];
	}
	[pool release];

	return element;
}
@end