Added missing XmlParser::parseMemory() in ExpatXmlParser.cc

pull/4/head
Tatsuhiro Tsujikawa 2011-12-01 23:34:14 +09:00
parent 82e5318e35
commit f9dd59eebd
1 changed files with 11 additions and 0 deletions

View File

@ -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