| 291 | } |
| 292 | |
| 293 | void Base::XMLReader::readEndElement(const char* ElementName, int level) |
| 294 | { |
| 295 | endCharStream(); |
| 296 | |
| 297 | // if we are already at the end of the current element |
| 298 | if ((ReadType == EndElement || ReadType == StartEndElement) && ElementName |
| 299 | && LocalName == ElementName && (level < 0 || level == Level)) { |
| 300 | return; |
| 301 | } |
| 302 | if (ReadType == EndDocument) { |
| 303 | // the end of the document has been reached but we still try to continue on reading |
| 304 | throw Base::XMLParseException("End of document reached"); |
| 305 | } |
| 306 | |
| 307 | bool ok {}; |
| 308 | do { |
| 309 | ok = read(); |
| 310 | if (!ok) { |
| 311 | break; |
| 312 | } |
| 313 | if (ReadType == EndDocument) { |
| 314 | break; |
| 315 | } |
| 316 | } while (ReadType != EndElement |
| 317 | || (ElementName && (LocalName != ElementName || (level >= 0 && level != Level)))); |
| 318 | } |
| 319 | |
| 320 | void Base::XMLReader::readCharacters(const char* filename, CharStreamFormat format) |
| 321 | { |
no test coverage detected