diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2017-03-16 15:29:19 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2017-03-16 15:47:33 +0000 |
commit | 7afa0eff4341b70dc7317dd17e3eb3e7ef58e4ee (patch) | |
tree | 1759c11e0286ff54aee39b36cca74b222973dd9a /ApiExtractor/typesystem_p.h | |
parent | 3813dbae665507eaa5efb3129ced6835895b3fe5 (diff) |
TypeDatabase: Port to QXmlStreamReader
The old QtXml classes are deprecated.
Change-Id: Icde985d352df5bbaca89b23e0fea1d4efe8e2fb4
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'ApiExtractor/typesystem_p.h')
-rw-r--r-- | ApiExtractor/typesystem_p.h | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/ApiExtractor/typesystem_p.h b/ApiExtractor/typesystem_p.h index a41f6cd74..d359f9b45 100644 --- a/ApiExtractor/typesystem_p.h +++ b/ApiExtractor/typesystem_p.h @@ -29,9 +29,11 @@ #define TYPESYSTEM_P_H #include <QStack> -#include <QtXml/QXmlDefaultHandler> #include "typesystem.h" +QT_FORWARD_DECLARE_CLASS(QXmlStreamAttributes) +QT_FORWARD_DECLARE_CLASS(QXmlStreamReader) + class TypeDatabase; class StackElement { @@ -129,31 +131,21 @@ struct StackElementContext DocModificationList docModifications; }; -class Handler : public QXmlDefaultHandler +class Handler { public: Handler(TypeDatabase* database, bool generate); - bool startElement(const QString& namespaceURI, const QString& localName, - const QString& qName, const QXmlAttributes& atts); - bool endElement(const QString& namespaceURI, const QString& localName, const QString& qName); - - QString errorString() const - { - return m_error; - } - - bool error(const QXmlParseException &exception); - bool fatalError(const QXmlParseException &exception); - bool warning(const QXmlParseException &exception); - - bool characters(const QString &ch); + bool parse(QXmlStreamReader &reader); private: - void fetchAttributeValues(const QString &name, const QXmlAttributes &atts, + bool startElement(const QStringRef& localName, const QXmlStreamAttributes& atts); + bool endElement(const QStringRef& localName); + bool characters(const QString &ch); + void fetchAttributeValues(const QString &name, const QXmlStreamAttributes &atts, QHash<QString, QString> *acceptedAttributes); - bool importFileElement(const QXmlAttributes &atts); + bool importFileElement(const QXmlStreamAttributes &atts); bool convertBoolean(const QString &, const QString &, bool); void addFlags(const QString &name, QString flagName, const QHash<QString, QString> &attributes, double since); |