ObjFW  Diff

Differences From Artifact [8b7255c2dd]:

To Artifact [79011c0f14]:


67
68
69
70
71
72
73
74

75
76
77
78


79
80
81
82
83
84
85
67
68
69
70
71
72
73

74
75
76


77
78
79
80
81
82
83
84
85







-
+


-
-
+
+







	return [OFString stringWithCString: buf
				    length: i];
}

@implementation OFString (XMLUnescaping)
- (OFString*)stringByXMLUnescaping
{
	return [self stringByXMLUnescapingWithHandler: nil];
	return [self stringByXMLUnescapingWithDelegate: nil];
}

- (OFString*)stringByXMLUnescapingWithHandler:
    (OFObject <OFStringXMLUnescapingDelegate>*)h
- (OFString*)stringByXMLUnescapingWithDelegate:
    (OFObject <OFStringXMLUnescapingDelegate>*)delegate
{
	size_t i, last;
	BOOL in_entity;
	OFMutableString *ret;

	last = 0;
	in_entity = NO;
128
129
130
131
132
133
134
135

136
137
138
139
140
141
142

143

144
145
146
147
148
149
150
128
129
130
131
132
133
134

135
136
137
138
139
140
141
142
143

144
145
146
147
148
149
150
151







-
+







+
-
+








				if (tmp == nil)
					@throw [OFInvalidEncodingException
					    newWithClass: isa];

				[ret appendString: tmp];
				[pool release];
			} else if (h != nil) {
			} else if (delegate != nil) {
				OFAutoreleasePool *pool;
				OFString *n, *tmp;

				pool = [[OFAutoreleasePool alloc] init];

				n = [OFString stringWithCString: entity
							 length: len];
				tmp =	  [delegate string: self
				tmp = [h didFindUnknownEntityNamed: n];
				containsUnknownEntityNamed: n];

				if (tmp == nil)
					@throw [OFInvalidEncodingException
					    newWithClass: isa];

				[ret appendString: tmp];
				[pool release];