ObjFW  Diff

Differences From Artifact [d1e25b4850]:

To Artifact [872a1be8d0]:


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

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

	@try {
		characters = [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 {
		_characters = [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

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

		characters = [[element stringValue] copy];

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

	return self;
}

- (BOOL)isEqual: (id)object
{
	OFXMLCharacters *otherCharacters;

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

	otherCharacters = object;

	return ([otherCharacters->characters isEqual: characters]);
}

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

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

- (OFString*)XMLString
{
	return [characters stringByXMLEscaping];
}

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

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

- (OFString*)description
{
	return [characters stringByXMLEscaping];
}

- (OFXMLElement*)XMLElementBySerializing
{
	return [OFXMLElement elementWithName: [self className]
				   namespace: OF_SERIALIZATION_NS
				 stringValue: characters];
}
@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

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

		_characters = [[element stringValue] copy];

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

	return self;
}

- (BOOL)isEqual: (id)object
{
	OFXMLCharacters *characters;

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

	characters = object;

	return ([characters->_characters isEqual: _characters]);
}

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

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

- (OFString*)XMLString
{
	return [_characters stringByXMLEscaping];
}

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

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

- (OFString*)description
{
	return [_characters stringByXMLEscaping];
}

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