| 348 | |
| 349 | |
| 350 | void ParserEngine::parseExternalCharInputStream(XML_Parser extParser, XMLCharInputStream& istr) |
| 351 | { |
| 352 | XMLChar *pBuffer = new XMLChar[PARSE_BUFFER_SIZE/sizeof(XMLChar)]; |
| 353 | try |
| 354 | { |
| 355 | std::streamsize n = readChars(istr, pBuffer, PARSE_BUFFER_SIZE/sizeof(XMLChar)); |
| 356 | while (n > 0) |
| 357 | { |
| 358 | if (!XML_Parse(extParser, reinterpret_cast<char*>(pBuffer), static_cast<int>(n*sizeof(XMLChar)), 0)) |
| 359 | handleError(XML_GetErrorCode(extParser)); |
| 360 | if (istr.good()) |
| 361 | n = readChars(istr, pBuffer, static_cast<int>(PARSE_BUFFER_SIZE/sizeof(XMLChar))); |
| 362 | else |
| 363 | n = 0; |
| 364 | } |
| 365 | if (!XML_Parse(extParser, reinterpret_cast<char*>(pBuffer), 0, 1)) |
| 366 | handleError(XML_GetErrorCode(extParser)); |
| 367 | } |
| 368 | catch (...) |
| 369 | { |
| 370 | delete [] pBuffer; |
| 371 | throw; |
| 372 | } |
| 373 | delete [] pBuffer; |
| 374 | } |
| 375 | |
| 376 | |
| 377 | std::streamsize ParserEngine::readBytes(XMLByteInputStream& istr, char* pBuffer, std::streamsize bufferSize) |
nothing calls this directly
no test coverage detected