summaryrefslogtreecommitdiff
path: root/src/plugins/xml/XmlParser.cpp
diff options
context:
space:
mode:
authorAndreas Stöckel <astoecke@techfak.uni-bielefeld.de>2014-12-11 21:46:11 +0100
committerAndreas Stöckel <astoecke@techfak.uni-bielefeld.de>2014-12-11 21:46:11 +0100
commit741463dd18efd8d126bcc70224025703858fdef7 (patch)
tree82f83172a3229f14957b6c3f90fd10180c6b2612 /src/plugins/xml/XmlParser.cpp
parent3f62168ed0b088eec3cb2903f03966f7d501f564 (diff)
refactored logger
Diffstat (limited to 'src/plugins/xml/XmlParser.cpp')
-rw-r--r--src/plugins/xml/XmlParser.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/plugins/xml/XmlParser.cpp b/src/plugins/xml/XmlParser.cpp
index 9a7b4d8..824219a 100644
--- a/src/plugins/xml/XmlParser.cpp
+++ b/src/plugins/xml/XmlParser.cpp
@@ -204,11 +204,15 @@ Rooted<Node> XmlParser::parse(std::istream &is, ParserContext &ctx)
// Parse the data and handle any XML error
if (!XML_ParseBuffer(&p, bytesRead, bytesRead == 0)) {
- const int line = XML_GetCurrentLineNumber(&p);
- const int column = XML_GetCurrentColumnNumber(&p);
+ const TextCursor::PosType line =
+ static_cast<TextCursor::PosType>(XML_GetCurrentLineNumber(&p));
+ const TextCursor::PosType column = static_cast<TextCursor::PosType>(
+ XML_GetCurrentColumnNumber(&p));
+ const size_t offs = XML_GetCurrentByteIndex(&p);
const XML_Error code = XML_GetErrorCode(&p);
const std::string msg = std::string{XML_ErrorString(code)};
- throw ParserException{"XML Syntax Error: " + msg, line, column};
+ throw ParserException{"XML Syntax Error: " + msg, line, column,
+ offs};
}
// Abort once there are no more bytes in the stream