Skip to content

Commit

Permalink
Add QXmlStreamReader based ctor to QXmlStreamReaderError
Browse files Browse the repository at this point in the history
  • Loading branch information
oblivioncth committed Jul 18, 2023
1 parent 036444f commit 44ffc33
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/xml/include/qx/xml/qx-xmlstreamreadererror.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class QX_XML_EXPORT XmlStreamReaderError
XmlStreamReaderError();
XmlStreamReaderError(QXmlStreamReader::Error standardError);
XmlStreamReaderError(QString customError);
XmlStreamReaderError(const QXmlStreamReader& streamReader);

//-Instance Functions--------------------------------------------------------------------------------------------
public:
Expand Down
8 changes: 8 additions & 0 deletions lib/xml/src/qx-xmlstreamreadererror.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(mErrorType == QXmlStreamReader::CustomError ? streamReader.errorString() : STD_ERR_TXT.value(mErrorType))
{}

//-Instance Functions--------------------------------------------------------------------------------------------
//Public:
/*!
Expand Down

0 comments on commit 44ffc33

Please sign in to comment.