summaryrefslogtreecommitdiffstats
path: root/src/corelib/serialization/qxmlstream.cpp
diff options
context:
space:
mode:
authorAxel Spoerl <axel.spoerl@qt.io>2023-04-21 13:36:29 +0200
committerAxel Spoerl <axel.spoerl@qt.io>2023-04-26 12:46:06 +0200
commit55a51e19091714a0ce7af3bfe0d06d138bc04bca (patch)
treeab3e5080ec508cb99426257c44b6021d058e8a9a /src/corelib/serialization/qxmlstream.cpp
parentb85a9d0ee16e3bdc817eb1e8a8f85026e631b401 (diff)
Implement QXmlStreamReader::hasStandaloneDeclaration()
This patch implements a public getter for the hasStandalone attribute. It returns true, if standalone has been explicitly declared in an XML header and false otherwise. As this is no longer necessary it removes accessing QXmlStreamPrivate from QDomParser. [ChangeLog][QtCore][QXmlStreamReader] added hasStandaloneDeclaration() Change-Id: Iaaa0a728a6f7186e40637186077f7b49c112f7a9 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Yuhang Zhao <yuhangzhao@deepin.org>
Diffstat (limited to 'src/corelib/serialization/qxmlstream.cpp')
-rw-r--r--src/corelib/serialization/qxmlstream.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/corelib/serialization/qxmlstream.cpp b/src/corelib/serialization/qxmlstream.cpp
index 5f536d0571..21590135dd 100644
--- a/src/corelib/serialization/qxmlstream.cpp
+++ b/src/corelib/serialization/qxmlstream.cpp
@@ -2692,6 +2692,8 @@ bool QXmlStreamReader::isCDATA() const
XML declaration; otherwise returns \c false.
If no XML declaration has been parsed, this function returns \c false.
+
+ \sa hasStandaloneDeclaration()
*/
bool QXmlStreamReader::isStandaloneDocument() const
{
@@ -2699,6 +2701,21 @@ bool QXmlStreamReader::isStandaloneDocument() const
return d->standalone;
}
+/*!
+ \since 6.6
+
+ Returns \c true if this document has an explicit standalone
+ declaration (can be 'yes' or 'no'); otherwise returns \c false;
+
+ If no XML declaration has been parsed, this function returns \c false.
+
+ \sa isStandaloneDocument()
+ */
+bool QXmlStreamReader::hasStandaloneDeclaration() const
+{
+ Q_D(const QXmlStreamReader);
+ return d->hasStandalone;
+}
/*!
\since 4.4