Overview
Comment: | Add -[lineNumber] to OFXMLParser. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
1e64693064fba209c5f2db1f69330854 |
User & Date: | js on 2010-12-09 23:45:06 |
Other Links: | manifest | tags |
Context
2010-12-10
| ||
01:19 | Bring some consistency into the style of configure.ac. check-in: 851dce0bce user: js tags: trunk | |
2010-12-09
| ||
23:45 | Add -[lineNumber] to OFXMLParser. check-in: 1e64693064 user: js tags: trunk | |
19:40 | Add -[finishedParsing] to OFXMLParser. check-in: 58a72fc69b user: js tags: trunk | |
Changes
Modified src/OFXMLParser.h from [6f9a183c8c] to [4ec07ce01d].
︙ | |||
163 164 165 166 167 168 169 170 171 172 173 174 175 176 | 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 | + + | of_xml_parser_element_end_block_t elementEndHandler; of_xml_parser_string_block_t charactersHandler; of_xml_parser_string_block_t CDATAHandler; of_xml_parser_string_block_t commentHandler; of_xml_parser_unknown_entity_block_t unknownEntityHandler; #endif size_t level; size_t lineNumber; BOOL lastCarriageReturn; BOOL finishedParsing; } #ifdef OF_HAVE_PROPERTIES @property (retain) id <OFXMLParserDelegate> delegate; # ifdef OF_HAVE_BLOCKS @property (copy) of_xml_parser_processing_instructions_block_t |
︙ | |||
314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 | 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 | + + + + + | /** * Parses the specified file. * * \param path The path to the file to parse */ - (void)parseFile: (OFString*)path; /** * \return The current line number */ - (size_t)lineNumber; /** * \return Whether the XML parser has finished parsing */ - (BOOL)finishedParsing; @end @interface OFObject (OFXMLParserDelegate) <OFXMLParserDelegate> @end |
Modified src/OFXMLParser.m from [8a551b940b] to [d446a92ae5].
︙ | |||
141 142 143 144 145 146 147 148 149 150 151 152 153 154 | 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 | + + + | namespaces = [[OFMutableArray alloc] init]; pool = [[OFAutoreleasePool alloc] init]; dict = [OFMutableDictionary dictionaryWithKeysAndObjects: @"xml", @"http://www.w3.org/XML/1998/namespace", @"xmlns", @"http://www.w3.org/2000/xmlns/", nil]; [namespaces addObject: dict]; lineNumber = 1; [pool release]; } @catch (id e) { [self release]; @throw e; } return self; |
︙ | |||
201 202 203 204 205 206 207 | 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 | - + + + + + + + + + + + + + | buf[i] != '\n' && buf[i] != '\r') @throw [OFMalformedXMLException newWithClass: isa]; return; } |
︙ | |||
888 889 890 891 892 893 894 895 896 897 898 899 900 901 | 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 | + + + + + | state = OF_XMLPARSER_OUTSIDE_TAG; else level--; } *last = *i + 1; } - (size_t)lineNumber { return lineNumber; } - (BOOL)finishedParsing { return finishedParsing; } - (OFString*)string: (OFString*)string |
︙ |
Modified tests/OFXMLParserTests.m from [61a6d285b6] to [542c5c5171].
︙ | |||
20 21 22 23 24 25 26 27 28 29 30 31 32 33 | 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | + | #import "OFAutoreleasePool.h" #import "OFString.h" #import "OFExceptions.h" #import "TestsAppDelegate.h" static OFString *module = @"OFXMLParser"; static OFXMLParser *parser; static int i = 0; enum event_type { PROCESSING_INSTRUCTIONS, TAG_START, TAG_END, STRING, |
︙ | |||
58 59 60 61 62 63 64 | 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | - + - + + | [string isEqual: @"p?i"]) break; case 3: TEST(msg, et == TAG_START && [name isEqual: @"root"] && prefix == nil && ns == nil && [attrs count] == 0) break; case 4: |
︙ | |||
312 313 314 315 316 317 318 | 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 | - - + - + | return nil; } - (void)XMLParserTests { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; |
︙ | |||
349 350 351 352 353 354 355 | 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 | - + + | [parser parseBuffer: str + j withSize: 1]; else [parser parseBuffer: str + j withSize: 2]; } |