| 83 | } |
| 84 | |
| 85 | int cmXMLParser::CleanupParser() |
| 86 | { |
| 87 | if (!this->Parser) { |
| 88 | std::cerr << "Parser not initialized" << std::endl; |
| 89 | this->ParseError = 1; |
| 90 | return 0; |
| 91 | } |
| 92 | int result = !this->ParseError; |
| 93 | if (result) { |
| 94 | // Tell the expat XML parser about the end-of-input. |
| 95 | if (!XML_Parse(static_cast<XML_Parser>(this->Parser), "", 0, 1)) { |
| 96 | this->ReportXmlParseError(); |
| 97 | result = 0; |
| 98 | } |
| 99 | } |
| 100 | |
| 101 | // Clean up the parser. |
| 102 | XML_ParserFree(static_cast<XML_Parser>(this->Parser)); |
| 103 | this->Parser = nullptr; |
| 104 | |
| 105 | return result; |
| 106 | } |
| 107 | |
| 108 | int cmXMLParser::ParseBuffer(char const* buffer, std::string::size_type count) |
| 109 | { |