summaryrefslogtreecommitdiffstats
path: root/src/corelib/serialization
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2023-05-04 16:35:05 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2023-05-15 14:02:43 +0200
commit7337474d041d7e4a7a33157ebd7d84406ed13966 (patch)
tree80870e7ae809ad732ac862bdd96010cbf809f27e /src/corelib/serialization
parent526ce669ed41e3285fb13a1e3f394d7722db3ab3 (diff)
Convert remaining QT_NO_XMLSTREAM* to use feature system
Replace the check in qxmlstream.h with a QT_REQUIRE_CONFIG since the code that includes this header does no checking, whether on the define or the feature, so is better off getting told about the missing feature at the point of include than complaining about an undefined type despite its header being overtly included. For the rest, just do the usual transformation to QT_CONFIG(), flipping the ones that were #ifdef rather than #ifndef, so the condition is positive. Shifted a couple of open-braces of classes to the next line, where they belong, in the process. Change-Id: If9c496082f0489b0f9f4070364cbf840e603fce1 Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src/corelib/serialization')
-rw-r--r--src/corelib/serialization/qxmlstream.cpp27
-rw-r--r--src/corelib/serialization/qxmlstream.g4
-rw-r--r--src/corelib/serialization/qxmlstream.h16
-rw-r--r--src/corelib/serialization/qxmlstreamparser_p.h4
4 files changed, 26 insertions, 25 deletions
diff --git a/src/corelib/serialization/qxmlstream.cpp b/src/corelib/serialization/qxmlstream.cpp
index 0c7c2196d2..61c9f343ec 100644
--- a/src/corelib/serialization/qxmlstream.cpp
+++ b/src/corelib/serialization/qxmlstream.cpp
@@ -3,7 +3,7 @@
#include "QtCore/qxmlstream.h"
-#ifndef QT_NO_XMLSTREAM
+#if QT_CONFIG(xmlstream)
#include "qxmlutils_p.h"
#include <qdebug.h>
@@ -232,7 +232,7 @@ QString QXmlStreamEntityResolver::resolveUndeclaredEntity(const QString &/*name*
return QString();
}
-#ifndef QT_NO_XMLSTREAMREADER
+#if QT_CONFIG(xmlstreamreader)
QString QXmlStreamReaderPrivate::resolveUndeclaredEntity(const QString &name)
{
@@ -777,7 +777,7 @@ QString QXmlStreamReader::tokenString() const
return QLatin1StringView(QXmlStreamReader_tokenTypeString.at(d->type));
}
-#endif // QT_NO_XMLSTREAMREADER
+#endif // feature xmlstreamreader
QXmlStreamPrivateTagStack::QXmlStreamPrivateTagStack()
{
@@ -791,7 +791,7 @@ QXmlStreamPrivateTagStack::QXmlStreamPrivateTagStack()
tagsDone = false;
}
-#ifndef QT_NO_XMLSTREAMREADER
+#if QT_CONFIG(xmlstreamreader)
QXmlStreamReaderPrivate::QXmlStreamReaderPrivate(QXmlStreamReader *q)
:q_ptr(q)
@@ -2272,7 +2272,7 @@ QXmlStreamAttributes QXmlStreamReader::attributes() const
return d->attributes;
}
-#endif // QT_NO_XMLSTREAMREADER
+#endif // feature xmlstreamreader
/*!
\class QXmlStreamAttribute
@@ -2631,7 +2631,7 @@ void QXmlStreamAttributes::append(const QString &qualifiedName, const QString &v
append(QXmlStreamAttribute(qualifiedName, value));
}
-#ifndef QT_NO_XMLSTREAMREADER
+#if QT_CONFIG(xmlstreamreader)
/*! \fn bool QXmlStreamReader::isStartDocument() const
Returns \c true if tokenType() equals \l StartDocument; otherwise returns \c false.
@@ -2747,7 +2747,7 @@ QStringView QXmlStreamReader::documentEncoding() const
return QStringView();
}
-#endif // QT_NO_XMLSTREAMREADER
+#endif // feature xmlstreamreader
/*!
\class QXmlStreamWriter
@@ -2824,9 +2824,10 @@ QStringView QXmlStreamReader::documentEncoding() const
*/
-#ifndef QT_NO_XMLSTREAMWRITER
+#if QT_CONFIG(xmlstreamwriter)
-class QXmlStreamWriterPrivate : public QXmlStreamPrivateTagStack {
+class QXmlStreamWriterPrivate : public QXmlStreamPrivateTagStack
+{
QXmlStreamWriter *q_ptr;
Q_DECLARE_PUBLIC(QXmlStreamWriter)
public:
@@ -3746,7 +3747,7 @@ void QXmlStreamWriterPrivate::writeStartElement(QAnyStringView namespaceUri, QAn
tag.namespaceDeclarationsSize = lastNamespaceDeclaration;
}
-#ifndef QT_NO_XMLSTREAMREADER
+#if QT_CONFIG(xmlstreamreader)
/*! Writes the current state of the \a reader. All possible valid
states are supported.
@@ -3827,9 +3828,9 @@ void QXmlStreamWriter::writeCurrentToken(const QXmlStreamReader &reader)
otherwise returns \c false.
*/
-#endif // QT_NO_XMLSTREAMREADER
-#endif // QT_NO_XMLSTREAMWRITER
+#endif // feature xmlstreamreader
+#endif // feature xmlstreamwriter
QT_END_NAMESPACE
-#endif // QT_NO_XMLSTREAM
+#endif // feature xmlstream
diff --git a/src/corelib/serialization/qxmlstream.g b/src/corelib/serialization/qxmlstream.g
index d06c371eb8..59ca1a15c7 100644
--- a/src/corelib/serialization/qxmlstream.g
+++ b/src/corelib/serialization/qxmlstream.g
@@ -149,7 +149,7 @@
QT_BEGIN_NAMESPACE
-#ifndef QT_NO_XMLSTREAMREADER
+#if QT_CONFIG(xmlstreamreader)
bool QXmlStreamReaderPrivate::parse()
{
@@ -1478,7 +1478,7 @@ nmtoken ::= COLON;
return false;
}
-#endif
+#endif // feature xmlstreamreader
QT_END_NAMESPACE
diff --git a/src/corelib/serialization/qxmlstream.h b/src/corelib/serialization/qxmlstream.h
index fc0742debc..c4579bf905 100644
--- a/src/corelib/serialization/qxmlstream.h
+++ b/src/corelib/serialization/qxmlstream.h
@@ -6,7 +6,7 @@
#include <QtCore/qiodevice.h>
-#ifndef QT_NO_XMLSTREAM
+QT_REQUIRE_CONFIG(xmlstream);
#include <QtCore/qlist.h>
#include <QtCore/qscopedpointer.h>
@@ -176,8 +176,9 @@ public:
virtual QString resolveUndeclaredEntity(const QString &name);
};
-#ifndef QT_NO_XMLSTREAMREADER
-class Q_CORE_EXPORT QXmlStreamReader {
+#if QT_CONFIG(xmlstreamreader)
+class Q_CORE_EXPORT QXmlStreamReader
+{
QDOC_PROPERTY(bool namespaceProcessing READ namespaceProcessing WRITE setNamespaceProcessing)
public:
enum TokenType {
@@ -314,9 +315,9 @@ private:
QScopedPointer<QXmlStreamReaderPrivate> d_ptr;
};
-#endif // QT_NO_XMLSTREAMREADER
+#endif // feature xmlstreamreader
-#ifndef QT_NO_XMLSTREAMWRITER
+#if QT_CONFIG(xmlstreamwriter)
class QXmlStreamWriterPrivate;
@@ -402,7 +403,7 @@ public:
void writeStartElement(QAnyStringView qualifiedName);
void writeStartElement(QAnyStringView namespaceUri, QAnyStringView name);
-#ifndef QT_NO_XMLSTREAMREADER
+#if QT_CONFIG(xmlstreamreader)
void writeCurrentToken(const QXmlStreamReader &reader);
#endif
@@ -413,9 +414,8 @@ private:
Q_DECLARE_PRIVATE(QXmlStreamWriter)
QScopedPointer<QXmlStreamWriterPrivate> d_ptr;
};
-#endif // QT_NO_XMLSTREAMWRITER
+#endif // feature xmlstreamwriter
QT_END_NAMESPACE
-#endif // QT_NO_XMLSTREAM
#endif // QXMLSTREAM_H
diff --git a/src/corelib/serialization/qxmlstreamparser_p.h b/src/corelib/serialization/qxmlstreamparser_p.h
index 71d5d06081..7040cc3a48 100644
--- a/src/corelib/serialization/qxmlstreamparser_p.h
+++ b/src/corelib/serialization/qxmlstreamparser_p.h
@@ -38,7 +38,7 @@
QT_BEGIN_NAMESPACE
-#ifndef QT_NO_XMLSTREAMREADER
+#if QT_CONFIG(xmlstreamreader)
bool QXmlStreamReaderPrivate::parse()
{
@@ -989,7 +989,7 @@ bool QXmlStreamReaderPrivate::parse()
return false;
}
-#endif
+#endif // feature xmlstreamreader
QT_END_NAMESPACE