ObjFW  Diff

Differences From Artifact [cfcfb31543]:

To Artifact [7cb96fc45d]:


49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
- (instancetype)initWithSerialization: (OFXMLElement *)element
{
	self = [super of_init];

	@try {
		void *pool = objc_autoreleasePoolPush();

		if (![[element name] isEqual: [self className]] ||
		    ![[element namespace] isEqual: OF_SERIALIZATION_NS])
			@throw [OFInvalidArgumentException exception];

		_comment = [[element stringValue] copy];

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








|
|


|







49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
- (instancetype)initWithSerialization: (OFXMLElement *)element
{
	self = [super of_init];

	@try {
		void *pool = objc_autoreleasePoolPush();

		if (![element.name isEqual: self.className] ||
		    ![element.namespace isEqual: OF_SERIALIZATION_NS])
			@throw [OFInvalidArgumentException exception];

		_comment = [element.stringValue copy];

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

88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
	comment = object;

	return ([comment->_comment isEqual: _comment]);
}

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

- (OFString *)stringValue
{
	return @"";
}








|







88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
	comment = object;

	return ([comment->_comment isEqual: _comment]);
}

- (uint32_t)hash
{
	return _comment.hash;
}

- (OFString *)stringValue
{
	return @"";
}

137
138
139
140
141
142
143
144
145
146
147
148
- (OFString *)description
{
	return [OFString stringWithFormat: @"<!--%@-->", _comment];
}

- (OFXMLElement *)XMLElementBySerializing
{
	return [OFXMLElement elementWithName: [self className]
				   namespace: OF_SERIALIZATION_NS
				 stringValue: _comment];
}
@end







|




137
138
139
140
141
142
143
144
145
146
147
148
- (OFString *)description
{
	return [OFString stringWithFormat: @"<!--%@-->", _comment];
}

- (OFXMLElement *)XMLElementBySerializing
{
	return [OFXMLElement elementWithName: self.className
				   namespace: OF_SERIALIZATION_NS
				 stringValue: _comment];
}
@end