diff options
author | Sona Kurazyan <sona.kurazyan@qt.io> | 2019-11-13 15:38:28 +0100 |
---|---|---|
committer | Sona Kurazyan <sona.kurazyan@qt.io> | 2019-12-18 17:21:52 +0100 |
commit | 0e44a69b3546f259cd01bac1a5d10e86b287eb45 (patch) | |
tree | e342f435b08937f9b0664ea9b9c9eaf8541054ba /tests/auto/xmlpatternssdk/TestResultHandler.h | |
parent | 159d7230d301f999633eecef25f8569f5e8831b6 (diff) | |
download | qtxmlpatterns-0e44a69b3546f259cd01bac1a5d10e86b287eb45.tar.gz |
Stop using SAX classes for reading XML files
The qtxmlpatterns' tests are using SAX classes for parsing XML files.
These classes will be deprecated.
Replaced QXmlSimpleReader by QDomDocument where applicable.
For the test suite handlers inheriting from QXmlDefaultHandler, introduced
the XmlParseHelper base class, which drives the parsing loop and allows
overriding the methods for handling different XML tokens.
Task-number: QTBUG-76177
Change-Id: Ia1a60c898a272906ede459e95ced7ec95d154fde
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'tests/auto/xmlpatternssdk/TestResultHandler.h')
-rw-r--r-- | tests/auto/xmlpatternssdk/TestResultHandler.h | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/tests/auto/xmlpatternssdk/TestResultHandler.h b/tests/auto/xmlpatternssdk/TestResultHandler.h index 728b7e8..014c739 100644 --- a/tests/auto/xmlpatternssdk/TestResultHandler.h +++ b/tests/auto/xmlpatternssdk/TestResultHandler.h @@ -31,9 +31,9 @@ #include <QHash> #include <QString> -#include <QtXml/QXmlDefaultHandler> #include "TestResult.h" +#include "XmlParseHelper.h" QT_BEGIN_NAMESPACE @@ -46,7 +46,7 @@ namespace QPatternistSDK * @author Frans Englich <frans.englich@nokia.com> * @ingroup PatternistSDK */ - class TestResultHandler : public QXmlDefaultHandler + class TestResultHandler : public XmlParseHelper { public: /** @@ -68,15 +68,13 @@ namespace QPatternistSDK /** * Performs finalization. */ - virtual bool endDocument(); + bool endDocument() override; /** * Reads the <tt>test-case</tt> element and its attributes, everything else is ignored. */ - virtual bool startElement(const QString &namespaceURI, - const QString &localName, - const QString &qName, - const QXmlAttributes &atts); + bool startElement(const QStringRef &namespaceURI, const QStringRef &localName, + const QStringRef &qName, const QXmlStreamAttributes &atts) override; /** * @note Do not reimplement this function. * @returns the result obtained from reading the XML file. |