MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / ParseString

Method ParseString

lib/mdflib/mdflib/src/expatxml.cpp:149–164  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

147}
148
149bool 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
166void ExpatXml::Reset() {
167 IXmlFile::Reset();

Callers

nothing calls this directly

Calls 3

ParseMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected