From 741463dd18efd8d126bcc70224025703858fdef7 Mon Sep 17 00:00:00 2001 From: Andreas Stöckel Date: Thu, 11 Dec 2014 21:46:11 +0100 Subject: refactored logger --- src/plugins/xml/XmlParser.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/plugins/xml/XmlParser.cpp') 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 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(XML_GetCurrentLineNumber(&p)); + const TextCursor::PosType column = static_cast( + 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 -- cgit v1.2.3