From 87e8c2c549ad3879f2415ec1891bd335296ab683 Mon Sep 17 00:00:00 2001 From: Christian Heimlich Date: Mon, 17 Jul 2023 20:24:19 -0400 Subject: [PATCH] Add QXmlStreamReader based ctor to QXmlStreamReaderError --- lib/xml/include/qx/xml/qx-xmlstreamreadererror.h | 1 + lib/xml/src/qx-xmlstreamreadererror.cpp | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/lib/xml/include/qx/xml/qx-xmlstreamreadererror.h b/lib/xml/include/qx/xml/qx-xmlstreamreadererror.h index d568519a..c67f751b 100644 --- a/lib/xml/include/qx/xml/qx-xmlstreamreadererror.h +++ b/lib/xml/include/qx/xml/qx-xmlstreamreadererror.h @@ -35,6 +35,7 @@ class QX_XML_EXPORT XmlStreamReaderError XmlStreamReaderError(); XmlStreamReaderError(QXmlStreamReader::Error standardError); XmlStreamReaderError(QString customError); + XmlStreamReaderError(const QXmlStreamReader& streamReader); //-Instance Functions-------------------------------------------------------------------------------------------- public: diff --git a/lib/xml/src/qx-xmlstreamreadererror.cpp b/lib/xml/src/qx-xmlstreamreadererror.cpp index 816e9019..c7c54f12 100644 --- a/lib/xml/src/qx-xmlstreamreadererror.cpp +++ b/lib/xml/src/qx-xmlstreamreadererror.cpp @@ -46,6 +46,14 @@ XmlStreamReaderError::XmlStreamReaderError(QString customError) : mErrorText(customError) {} +/*! + * Constructs a custom XML stream reader error from the current error state of stream @a streamReader. + */ +XmlStreamReaderError::XmlStreamReaderError(const QXmlStreamReader& streamReader) : + mErrorType(streamReader.error()), + mErrorText(STD_ERR_TXT.value(mErrorType)) +{} + //-Instance Functions-------------------------------------------------------------------------------------------- //Public: /*!