mirror of https://github.com/aria2/aria2
Added missing XmlParser::parseMemory() in ExpatXmlParser.cc
parent
82e5318e35
commit
f9dd59eebd
|
@ -218,4 +218,15 @@ bool XmlParser::parseBinaryStream(BinaryStream* bs)
|
|||
return XML_Parse(parser, 0, 0, 1) != XML_STATUS_ERROR && psm_->finished();
|
||||
}
|
||||
|
||||
bool XmlParser::parseMemory(const char* xml, size_t size)
|
||||
{
|
||||
SessionData sessionData(psm_);
|
||||
XML_Parser parser = createParser(&sessionData);
|
||||
auto_delete<XML_Parser> deleter(parser, XML_ParserFree);
|
||||
if(XML_Parse(parser, xml, size, 0) == XML_STATUS_ERROR) {
|
||||
return false;
|
||||
}
|
||||
return XML_Parse(parser, 0, 0, 1) != XML_STATUS_ERROR && psm_->finished();
|
||||
}
|
||||
|
||||
} // namespace aria2
|
||||
|
|
Loading…
Reference in New Issue