Differences From Artifact [c47060e7f9]:
- File
src/OFXMLElement.m
— part of check-in
[627511b032]
at
2020-11-14 12:23:55
on branch trunk
— Rename of_malloc and of_calloc
The new names should be more accurate. (user: js, size: 25876) [annotate] [blame] [check-ins using] [more...]
To Artifact [47bfb07248]:
- File src/OFXMLElement.m — part of check-in [6b21acb1a9] at 2020-12-29 13:11:55 on branch trunk — Let OFXMLElement take a stream instead of a file (user: js, size: 25857) [annotate] [blame] [check-ins using] [more...]
︙ | ︙ | |||
21 22 23 24 25 26 27 | #include <stdlib.h> #include <string.h> #include <assert.h> #import "OFXMLElement.h" | | | | | | > | | | | 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | #include <stdlib.h> #include <string.h> #include <assert.h> #import "OFXMLElement.h" #import "OFArray.h" #import "OFData.h" #import "OFDictionary.h" #import "OFStream.h" #import "OFString.h" #import "OFXMLAttribute.h" #import "OFXMLCDATA.h" #import "OFXMLCharacters.h" #import "OFXMLElementBuilder.h" #import "OFXMLNode+Private.h" #import "OFXMLParser.h" #import "OFInvalidArgumentException.h" #import "OFInvalidFormatException.h" #import "OFMalformedXMLException.h" #import "OFUnboundNamespaceException.h" /* References for static linking */ |
︙ | ︙ | |||
110 111 112 113 114 115 116 | } + (instancetype)elementWithXMLString: (OFString *)string { return [[[self alloc] initWithXMLString: string] autorelease]; } | < | | < | 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 | } + (instancetype)elementWithXMLString: (OFString *)string { return [[[self alloc] initWithXMLString: string] autorelease]; } + (instancetype)elementWithStream: (OFStream *)stream { return [[[self alloc] initWithStream: stream] autorelease]; } - (instancetype)init { OF_INVALID_INIT_METHOD } - (instancetype)initWithName: (OFString *)name |
︙ | ︙ | |||
230 231 232 233 234 235 236 | self = [delegate->_element retain]; objc_autoreleasePoolPop(pool); return self; } | < | | < | 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 | self = [delegate->_element retain]; objc_autoreleasePoolPop(pool); return self; } - (instancetype)initWithStream: (OFStream *)stream { void *pool; OFXMLParser *parser; OFXMLElementBuilder *builder; OFXMLElementElementBuilderDelegate *delegate; [self release]; pool = objc_autoreleasePoolPush(); parser = [OFXMLParser parser]; builder = [OFXMLElementBuilder elementBuilder]; delegate = [[[OFXMLElementElementBuilderDelegate alloc] init] autorelease]; parser.delegate = builder; builder.delegate = delegate; [parser parseStream: stream]; if (!parser.hasFinishedParsing) @throw [OFMalformedXMLException exceptionWithParser: parser]; self = [delegate->_element retain]; objc_autoreleasePoolPop(pool); return self; } - (instancetype)initWithSerialization: (OFXMLElement *)element { self = [super of_init]; @try { void *pool = objc_autoreleasePoolPush(); |
︙ | ︙ |