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: /*!