Qx
v0.5.8
Qt Extensions Library
Loading...
Searching...
No Matches
qx-xmlstreamreadererror.h
1
#ifndef QX_STREAMREADERERROR_H
2
#define QX_STREAMREADERERROR_H
3
4
// Shared Lib Support
5
#include "qx/xml/qx_xml_export.h"
6
7
// Qt Includes
8
#include <QXmlStreamReader>
9
#include <QHash>
10
11
using namespace
Qt::Literals::StringLiterals
;
12
13
namespace
Qx
14
{
15
16
class
QX_XML_EXPORT
XmlStreamReaderError
17
{
18
//-Class Members--------------------------------------------------------------------------------------------------
19
private
:
20
static
inline
const
QHash<QXmlStreamReader::Error, QString>
STD_ERR_TXT = {
21
{
QXmlStreamReader::NoError
, u
"No error has occurred."
_s},
22
{
QXmlStreamReader::CustomError
, u
"A custom error has been raised with raiseError()."
_s},
23
{
QXmlStreamReader::NotWellFormedError
, u
"The parser internally raised an error due to the read XML not being well-formed."
_s},
24
{
QXmlStreamReader::PrematureEndOfDocumentError
, u
"The input stream ended before a well-formed XML document was parsed."
_s},
25
{
QXmlStreamReader::UnexpectedElementError
, u
"The parser encountered an element that was different to those it expected."
_s}
26
};
27
//TODO: See if there is a better way to get strings of these errors, but it seems doubtful (there's a slight chance
28
// that calling device().errorString() on the reader might give these)
29
30
//-Instance Members----------------------------------------------------------------------------------------------
31
private
:
32
QXmlStreamReader::Error
mErrorType;
33
QString
mErrorText;
34
35
//-Constructor---------------------------------------------------------------------------------------------------
36
public
:
37
XmlStreamReaderError
();
38
XmlStreamReaderError
(
QXmlStreamReader::Error
standardError);
39
XmlStreamReaderError
(
QString
customError);
40
XmlStreamReaderError
(
const
QXmlStreamReader
& streamReader);
41
42
//-Instance Functions--------------------------------------------------------------------------------------------
43
public
:
44
bool
isValid();
45
QXmlStreamReader::Error
type();
46
QString
text();
47
};
48
49
}
50
51
#endif
// QX_STREAMREADERERROR_H
Qx::XmlStreamReaderError
The XmlStreamReaderError class provides a full error object for QXmlStreamReader, similar to other Qt...
Definition
qx-xmlstreamreadererror.h:17
Qx
The Qx namespace is the main namespace through which all non-global functionality of the Qx library i...
Definition
qx-processwaiter.cpp:5
QHash
QString
Qt::Literals::StringLiterals
QXmlStreamReader
QXmlStreamReader::NoError
NoError
lib
xml
include
qx
xml
qx-xmlstreamreadererror.h
Generated by
1.10.0