ObjFW  Diff

Differences From Artifact [80501e221c]:

To Artifact [3a90c3abbf]:


31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
}

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

	@try {
		CDATA = [string copy];
	} @catch (id e) {
		[self release];
		@throw e;
	}

	return self;
}







|







31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
}

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

	@try {
		_CDATA = [string copy];
	} @catch (id e) {
		[self release];
		@throw e;
	}

	return self;
}
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94

95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123

		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;
}

- (BOOL)isEqual: (id)object
{
	OFXMLCDATA *otherCDATA;

	if (![object isKindOfClass: [OFXMLCDATA class]])
		return NO;

	otherCDATA = object;

	return ([otherCDATA->CDATA isEqual: CDATA]);
}

- (uint32_t)hash
{
	return [CDATA hash];
}

- (OFString*)stringValue
{
	return [[CDATA copy] autorelease];
}

- (OFString*)XMLString
{

	return [OFString stringWithFormat: @"<![CDATA[%@]]>", CDATA];
}

- (OFString*)XMLStringWithIndentation: (unsigned int)indentation
{
	return [OFString stringWithFormat: @"<![CDATA[%@]]>", CDATA];
}

- (OFString*)XMLStringWithIndentation: (unsigned int)indentation
				level: (unsigned int)level
{
	return [OFString stringWithFormat: @"<![CDATA[%@]]>", CDATA];
}

- (OFString*)description
{
	return [OFString stringWithFormat: @"<![CDATA[%@]]>", CDATA];
}

- (OFXMLElement*)XMLElementBySerializing
{
	OFXMLElement *element =
	    [OFXMLElement elementWithName: [self className]
				namespace: OF_SERIALIZATION_NS];
	[element addChild: self];

	return element;
}
@end







|












|




|

|




|




|




>
|




|





|




|












53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124

		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;
}

- (BOOL)isEqual: (id)object
{
	OFXMLCDATA *CDATA;

	if (![object isKindOfClass: [OFXMLCDATA class]])
		return NO;

	CDATA = object;

	return ([CDATA->_CDATA isEqual: _CDATA]);
}

- (uint32_t)hash
{
	return [_CDATA hash];
}

- (OFString*)stringValue
{
	return [[_CDATA copy] autorelease];
}

- (OFString*)XMLString
{
	/* FIXME: What to do about ]]>? */
	return [OFString stringWithFormat: @"<![CDATA[%@]]>", _CDATA];
}

- (OFString*)XMLStringWithIndentation: (unsigned int)indentation
{
	return [self XMLString];
}

- (OFString*)XMLStringWithIndentation: (unsigned int)indentation
				level: (unsigned int)level
{
	return [self XMLString];
}

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

- (OFXMLElement*)XMLElementBySerializing
{
	OFXMLElement *element =
	    [OFXMLElement elementWithName: [self className]
				namespace: OF_SERIALIZATION_NS];
	[element addChild: self];

	return element;
}
@end