| 48 | } |
| 49 | |
| 50 | int cmXMLParser::InitializeParser() |
| 51 | { |
| 52 | if (this->Parser) { |
| 53 | std::cerr << "Parser already initialized" << std::endl; |
| 54 | this->ParseError = 1; |
| 55 | return 0; |
| 56 | } |
| 57 | |
| 58 | // Create the expat XML parser. |
| 59 | this->Parser = XML_ParserCreate(nullptr); |
| 60 | XML_SetElementHandler(static_cast<XML_Parser>(this->Parser), |
| 61 | &cmXMLParserStartElement, &cmXMLParserEndElement); |
| 62 | XML_SetCharacterDataHandler(static_cast<XML_Parser>(this->Parser), |
| 63 | &cmXMLParserCharacterDataHandler); |
| 64 | XML_SetUserData(static_cast<XML_Parser>(this->Parser), this); |
| 65 | this->ParseError = 0; |
| 66 | return 1; |
| 67 | } |
| 68 | |
| 69 | int cmXMLParser::ParseChunk(char const* inputString, |
| 70 | std::string::size_type length) |
no test coverage detected