summaryrefslogtreecommitdiff
path: root/tests/auto/xmlpatternssdk/XMLWriter.h
diff options
context:
space:
mode:
authorSona Kurazyan <sona.kurazyan@qt.io>2019-11-22 17:41:08 +0100
committerSona Kurazyan <sona.kurazyan@qt.io>2019-12-18 17:22:11 +0100
commit3839255e1c11c78046896a37948cda849b0c5bc8 (patch)
treeba56e4d0074536b356b03b28c2289cd1bc87d6c7 /tests/auto/xmlpatternssdk/XMLWriter.h
parent0e44a69b3546f259cd01bac1a5d10e86b287eb45 (diff)
downloadqtxmlpatterns-3839255e1c11c78046896a37948cda849b0c5bc8.tar.gz
Stop using SAX classes for writing XML in tests
Removed the dependency of XMLWriter from QXmlContentHandler and QXmlLexicalHandler which are about to be deprecated. There's no need in inheriting from these interfaces, the tests call the methods of XMLWriter directly via XMLWriter instance. Task-number: QTBUG-76177 Change-Id: I2fe237b962774a004a9014f3dab1b5de5072f180 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'tests/auto/xmlpatternssdk/XMLWriter.h')
-rw-r--r--tests/auto/xmlpatternssdk/XMLWriter.h84
1 files changed, 4 insertions, 80 deletions
diff --git a/tests/auto/xmlpatternssdk/XMLWriter.h b/tests/auto/xmlpatternssdk/XMLWriter.h
index 0051d66..3d17d50 100644
--- a/tests/auto/xmlpatternssdk/XMLWriter.h
+++ b/tests/auto/xmlpatternssdk/XMLWriter.h
@@ -31,8 +31,7 @@
#include "Global.h"
-#include <QtXml/QXmlContentHandler>
-#include <QtXml/QXmlLexicalHandler>
+#include <QXmlStreamAttributes>
QT_BEGIN_NAMESPACE
@@ -52,10 +51,6 @@ namespace QPatternistSDK
* specified in XMLWriter's constructor or via setDevice(). If writing to
* the device fails, the content functions such as startElement() returns @c false.
*
- * XMLWriter sub-classes QXmlContentHandler meaning it can serialize content
- * from any code that produces SAX events. The class can also be used manually,
- * by calling startElement(), endCDATA(), and so forth.
- *
* XMLWriter cannot be used to serialize multiple documents. One instance per
* document must be used.
*
@@ -95,8 +90,7 @@ namespace QPatternistSDK
* @author Frans Englich <frans.englich@nokia.com>
* @ingroup PatternistSDK
*/
- class XMLWriter : public QXmlContentHandler
- , public QXmlLexicalHandler
+ class XMLWriter
{
public:
/**
@@ -132,35 +126,8 @@ namespace QPatternistSDK
* To declare namespaces, don't put attributes with name <tt>xmlns:*</tt> in @p atts,
* but use startPrefixMapping().
*/
- virtual bool startElement(const QString &qName, const QXmlAttributes &atts = QXmlAttributes());
-
- /**
- *
- * Behaves essentially as startElement(const QString &qName, const QXmlAttributes &atts). This
- * function is used in conjunction with other SAX classes.
- *
- * The call:
- *
- * @code
- * startElement(QString(), QString(), qName, atts);
- * @endcode
- *
- * is equivalent to:
- *
- * @code
- * startElement(qName, atts);
- * @endcode
- *
- * @p namespaceURI and @p localName are not used. This function is
- * used in conjunction with other SAX classes.
- *
- * @returns @c false if failure occurs in writing to the QIODevice, otherwise
- * @c true
- */
- virtual bool startElement(const QString &namespaceURI,
- const QString &localName,
- const QString &qName,
- const QXmlAttributes &atts);
+ virtual bool startElement(const QString &qName,
+ const QXmlStreamAttributes &atts = QXmlStreamAttributes());
/**
* Signals the end of an element with name @p qName. @p qName must
@@ -174,31 +141,6 @@ namespace QPatternistSDK
virtual bool endElement(const QString &qName);
/**
- * Behaves essentially as endElement(const QString &qName). This function
- * is used when XMLWriter is used in SAX code.
- *
- * @p namespaceURI and @p localName are not used.
- *
- * The call:
- *
- * @code
- * endElement(QString(), QString(), qName);
- * @endcode
- *
- * is equivalent to:
- *
- * @code
- * endElement(qName);
- * @endcode
- *
- * @returns @c false if failure occurs in writing to the QIODevice, otherwise
- * @c true
- */
- virtual bool endElement(const QString &namespaceURI,
- const QString &localName,
- const QString &qName);
-
- /**
* A description of an error if it occurred. This is typically
* QIODevice::errorString(). If no error has occurred, an empty
* string is returned.
@@ -326,24 +268,6 @@ namespace QPatternistSDK
virtual bool ignorableWhitespace(const QString &ch);
/**
- * This function is not used by XMLWriter, but is implemented
- * in order to satisfy QXmlContentHandler's interface.
- */
- virtual bool endPrefixMapping(const QString &prefix);
-
- /**
- * This function is not used by XMLWriter, but is implemented
- * in order to satisfy QXmlContentHandler's interface.
- */
- virtual bool skippedEntity(const QString &name);
-
- /**
- * This function is not used by XMLWriter, but is implemented
- * in order to satisfy QXmlContentHandler's interface.
- */
- virtual void setDocumentLocator(QXmlLocator *);
-
- /**
* @returns the device XMLWriter writes its output to.
* XMLWriter does not own the device.
*/