MCPcopy Create free account
hub / github.com/WinMerge/winmerge / parseExternalCharInputStream

Method parseExternalCharInputStream

Externals/poco/XML/src/ParserEngine.cpp:350–374  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

348
349
350void 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
377std::streamsize ParserEngine::readBytes(XMLByteInputStream& istr, char* pBuffer, std::streamsize bufferSize)

Callers

nothing calls this directly

Calls 3

XML_ParseFunction · 0.85
XML_GetErrorCodeFunction · 0.85
goodMethod · 0.45

Tested by

no test coverage detected