| 147 | } |
| 148 | |
| 149 | bool ExpatXml::ParseString(const std::string &input) { |
| 150 | Reset(); |
| 151 | ExpatParser p(this); |
| 152 | bool ok = true; |
| 153 | auto ret = p.Parse(input.data(), input.size(), true); |
| 154 | if (ret != XML_STATUS_OK) { |
| 155 | const auto line = XML_GetCurrentLineNumber(p.parser_); |
| 156 | const auto column = XML_GetCurrentColumnNumber(p.parser_); |
| 157 | const auto error = XML_GetErrorCode(p.parser_); |
| 158 | const auto *error_text = XML_ErrorString(error); |
| 159 | MDF_ERROR() << "XML parser error. Line: " << line << ", Column: " << column |
| 160 | << ", Error: " << error_text << ", String: " << input; |
| 161 | ok = false; |
| 162 | } |
| 163 | return ok; |
| 164 | } |
| 165 | |
| 166 | void ExpatXml::Reset() { |
| 167 | IXmlFile::Reset(); |