ObjFW  Diff

Differences From Artifact [de756c000b]:

To Artifact [65a1f72f30]:


15
16
17
18
19
20
21
22
23
24


25
26
27
28
29
30
31
 */

#include "config.h"

#import "OFXMLCDATA.h"
#import "OFString.h"
#import "OFXMLElement.h"
#import "OFAutoreleasePool.h"

#import "OFInvalidArgumentException.h"



@implementation OFXMLCDATA
+ CDATAWithString: (OFString*)string
{
	return [[[self alloc] initWithString: string] autorelease];
}








<


>
>







15
16
17
18
19
20
21

22
23
24
25
26
27
28
29
30
31
32
 */

#include "config.h"

#import "OFXMLCDATA.h"
#import "OFString.h"
#import "OFXMLElement.h"


#import "OFInvalidArgumentException.h"

#import "autorelease.h"

@implementation OFXMLCDATA
+ CDATAWithString: (OFString*)string
{
	return [[[self alloc] initWithString: string] autorelease];
}

44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
}

- initWithSerialization: (OFXMLElement*)element
{
	self = [super init];

	@try {
		OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];

		if (![[element name] isEqual: [self className]] ||
		    ![[element namespace] isEqual: OF_SERIALIZATION_NS])
			@throw [OFInvalidArgumentException
			    exceptionWithClass: [self class]
				      selector: _cmd];

		CDATA = [[element stringValue] copy];

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

	return self;
}







|









|







45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
}

- initWithSerialization: (OFXMLElement*)element
{
	self = [super init];

	@try {
		void *pool = objc_autoreleasePoolPush();

		if (![[element name] isEqual: [self className]] ||
		    ![[element namespace] isEqual: OF_SERIALIZATION_NS])
			@throw [OFInvalidArgumentException
			    exceptionWithClass: [self class]
				      selector: _cmd];

		CDATA = [[element stringValue] copy];

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

	return self;
}