ObjFW  Diff

Differences From Artifact [eb5533890d]:

To Artifact [841823e28f]:


15
16
17
18
19
20
21









22
23
24
25
26
27
28

#import "OFXMLParser.h"
#import "OFAutoreleasePool.h"
#import "OFExceptions.h"
#import "OFMacros.h"

int _OFXMLParser_reference;










static OF_INLINE OFString*
parse_numeric_entity(const char *entity, size_t length)
{
	uint32_t c;
	size_t i;
	char buf[4];







>
>
>
>
>
>
>
>
>







15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37

#import "OFXMLParser.h"
#import "OFAutoreleasePool.h"
#import "OFExceptions.h"
#import "OFMacros.h"

int _OFXMLParser_reference;

static OF_INLINE OFString*
transform_string(OFString *cache, OFObject <OFXMLUnescapingDelegate> *handler)
{
	/* TODO: Support for xml:space */

	[cache removeLeadingAndTrailingWhitespaces];
	return [cache stringByXMLUnescapingWithHandler: handler];
}

static OF_INLINE OFString*
parse_numeric_entity(const char *entity, size_t length)
{
	uint32_t c;
	size_t i;
	char buf[4];
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
					[cache appendCString: buf + last
						  withLength: len];

				if ([cache length] > 0) {
					OFString *str;

					pool = [[OFAutoreleasePool alloc] init];
					str = [cache
					    stringByXMLUnescapingWithHandler:
					    self];

					[delegate xmlParser: self
						foundString: str];

					[pool release];
				}

				[cache setToCString: ""];







<
<
<
|







147
148
149
150
151
152
153



154
155
156
157
158
159
160
161
					[cache appendCString: buf + last
						  withLength: len];

				if ([cache length] > 0) {
					OFString *str;

					pool = [[OFAutoreleasePool alloc] init];



					str = transform_string(cache, self);
					[delegate xmlParser: self
						foundString: str];

					[pool release];
				}

				[cache setToCString: ""];