Differences From Artifact [b449554094]:
- File src/OFXMLElement.m — part of check-in [5329fe7c1a] at 2015-06-12 23:59:20 on branch trunk — Add support for and use the new ObjC generics (user: js, size: 27661) [annotate] [blame] [check-ins using]
To Artifact [1f70933951]:
- File
src/OFXMLElement.m
— part of check-in
[48980f2297]
at
2015-11-29 11:43:05
on branch trunk
— Make properties a requirement and clean up code
This increases the required GCC version from 4.0 to 4.6 (exception:
Apple GCC, which already supports this with >= 4.0 starting with OS X
10.5). Since even GCC 4.6 is really old by now, there is no point in
still supporting something even older and making the code ugly because
of that. While some hardware and OS support was dropped from GCC 4.6
compared to GCC 4.0, there is nothing in there that would be an
interesting target with the exception of BeOS maybe - but a port to BeOS
can also be achieved using the Haiku support. The other dropped OSes are
mostly old versions of OSes while newer ones are still being supported
(and those newer versions of those OSes still support the same
hardware). (user: js, size: 27300) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
66 67 68 69 70 71 72 73 74 75 76 77 78 79 | [_element release]; [super dealloc]; } @end @implementation OFXMLElement + (void)initialize { if (self == [OFXMLElement class]) { charactersClass = [OFXMLCharacters class]; CDATAClass = [OFXMLCDATA class]; } } | > > > | 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | [_element release]; [super dealloc]; } @end @implementation OFXMLElement @synthesize name = _name, namespace = _namespace; @synthesize defaultNamespace = _defaultNamespace; + (void)initialize { if (self == [OFXMLElement class]) { charactersClass = [OFXMLCharacters class]; CDATAClass = [OFXMLCDATA class]; } } |
︙ | ︙ | |||
221 222 223 224 225 226 227 | autorelease]; [parser setDelegate: builder]; [builder setDelegate: delegate]; [parser parseString: string]; | | | 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 | autorelease]; [parser setDelegate: builder]; [builder setDelegate: delegate]; [parser parseString: string]; if (![parser hasFinishedParsing]) @throw [OFMalformedXMLException exceptionWithParser: parser]; self = [delegate->_element retain]; objc_autoreleasePoolPop(pool); return self; |
︙ | ︙ | |||
253 254 255 256 257 258 259 | autorelease]; [parser setDelegate: builder]; [builder setDelegate: delegate]; [parser parseFile: path]; | | | 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 | autorelease]; [parser setDelegate: builder]; [builder setDelegate: delegate]; [parser parseFile: path]; if (![parser hasFinishedParsing]) @throw [OFMalformedXMLException exceptionWithParser: parser]; self = [delegate->_element retain]; objc_autoreleasePoolPop(pool); return self; |
︙ | ︙ | |||
365 366 367 368 369 370 371 | [_attributes release]; [_namespaces release]; [_children release]; [super dealloc]; } | < < < < < < < < < < < < < < < < < < < < < < < | | > > | | 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 | [_attributes release]; [_namespaces release]; [_children release]; [super dealloc]; } - (OFArray*)attributes { return [[_attributes copy] autorelease]; } - (void)setChildren: (OFArray*)children { OFArray *old = _children; _children = [children copy]; [old release]; } - (OFArray*)children { return [[_children copy] autorelease]; } - (void)setStringValue: (OFString*)stringValue { void *pool = objc_autoreleasePoolPush(); [self setChildren: [OFArray arrayWithObject: |
︙ | ︙ | |||
907 908 909 910 911 912 913 | [self setPrefix: prefix forNamespace: namespace]; [self addAttributeWithName: prefix namespace: @"http://www.w3.org/2000/xmlns/" stringValue: namespace]; } | < < < < < < < < < < | 889 890 891 892 893 894 895 896 897 898 899 900 901 902 | [self setPrefix: prefix forNamespace: namespace]; [self addAttributeWithName: prefix namespace: @"http://www.w3.org/2000/xmlns/" stringValue: namespace]; } - (void)addChild: (OFXMLNode*)child { if ([child isKindOfClass: [OFXMLAttribute class]]) @throw [OFInvalidArgumentException exception]; if (_children == nil) _children = [[OFMutableArray alloc] init]; |
︙ | ︙ |