7#include <QtCore/qiodevice.h>
9#if QT_CONFIG(xmlstream)
11#include <QtCore/qcompare.h>
12#include <QtCore/qlist.h>
13#include <QtCore/qscopedpointer.h>
14#include <QtCore/qstring.h>
25 QXmlString & operator=(
const QString &
s) { m_string =
s.data_ptr();
return *
this; }
26 QXmlString & operator=(
QString &&
s) { m_string.swap(
s.data_ptr());
return *
this; }
27 inline constexpr QXmlString() {}
31 m_string.swap(
other.m_string);
39Q_DECLARE_SHARED(QtPrivate::QXmlString)
43class QXmlStreamAttributes;
44class Q_CORE_EXPORT QXmlStreamAttribute {
45 QtPrivate::QXmlString m_name, m_namespaceUri, m_qualifiedName, m_value;
48 friend class QXmlStreamAttributes;
50 QXmlStreamAttribute();
54 inline QStringView namespaceUri()
const {
return m_namespaceUri; }
56 inline QStringView qualifiedName()
const {
return m_qualifiedName; }
58 return QStringView(m_qualifiedName).
left(
qMax(0, m_qualifiedName.size() - m_name.size() - 1));
61 inline bool isDefault()
const {
return m_isDefault; }
62#if QT_CORE_REMOVED_SINCE(6, 8)
71 const QXmlStreamAttribute &rhs)
noexcept
73 return (lhs.value() == rhs.value()
74 && (lhs.namespaceUri().isNull() ? (lhs.qualifiedName() == rhs.qualifiedName())
75 : (lhs.namespaceUri() == rhs.namespaceUri()
85class QXmlStreamAttributes :
public QList<QXmlStreamAttribute>
88 inline QXmlStreamAttributes() {}
89#if QT_CORE_REMOVED_SINCE(6, 6)
104 return !
value(qualifiedName).isNull();
109 return !
value(namespaceUri,
name).isNull();
115class Q_CORE_EXPORT QXmlStreamNamespaceDeclaration {
116 QtPrivate::QXmlString m_prefix, m_namespaceUri;
120 QXmlStreamNamespaceDeclaration();
121 QXmlStreamNamespaceDeclaration(
const QString &prefix,
const QString &namespaceUri);
123 inline QStringView prefix()
const {
return m_prefix; }
124 inline QStringView namespaceUri()
const {
return m_namespaceUri; }
125#if QT_CORE_REMOVED_SINCE(6, 8)
126 inline bool operator==(
const QXmlStreamNamespaceDeclaration &
other)
const
128 inline bool operator!=(
const QXmlStreamNamespaceDeclaration &
other)
const
132 friend bool comparesEqual(
const QXmlStreamNamespaceDeclaration &lhs,
133 const QXmlStreamNamespaceDeclaration &rhs)
noexcept
135 return (lhs.prefix() == rhs.prefix() && lhs.namespaceUri() == rhs.namespaceUri());
141typedef QList<QXmlStreamNamespaceDeclaration> QXmlStreamNamespaceDeclarations;
143class Q_CORE_EXPORT QXmlStreamNotationDeclaration {
144 QtPrivate::QXmlString m_name, m_systemId, m_publicId;
148 QXmlStreamNotationDeclaration();
151 inline QStringView systemId()
const {
return m_systemId; }
152 inline QStringView publicId()
const {
return m_publicId; }
153#if QT_CORE_REMOVED_SINCE(6, 8)
154 inline bool operator==(
const QXmlStreamNotationDeclaration &
other)
const
156 inline bool operator!=(
const QXmlStreamNotationDeclaration &
other)
const
160 friend bool comparesEqual(
const QXmlStreamNotationDeclaration &lhs,
161 const QXmlStreamNotationDeclaration &rhs)
noexcept
163 return (lhs.name() == rhs.name() && lhs.systemId() == rhs.systemId()
164 && lhs.publicId() == rhs.publicId());
170typedef QList<QXmlStreamNotationDeclaration> QXmlStreamNotationDeclarations;
172class Q_CORE_EXPORT QXmlStreamEntityDeclaration {
173 QtPrivate::QXmlString m_name, m_notationName, m_systemId, m_publicId, m_value;
177 QXmlStreamEntityDeclaration();
180 inline QStringView notationName()
const {
return m_notationName; }
181 inline QStringView systemId()
const {
return m_systemId; }
182 inline QStringView publicId()
const {
return m_publicId; }
184#if QT_CORE_REMOVED_SINCE(6, 8)
192 friend bool comparesEqual(
const QXmlStreamEntityDeclaration &lhs,
193 const QXmlStreamEntityDeclaration &rhs)
noexcept
195 return (lhs.name() == rhs.name()
196 && lhs.notationName() == rhs.notationName()
197 && lhs.systemId() == rhs.systemId()
198 && lhs.publicId() == rhs.publicId()
199 && lhs.value() == rhs.value());
205typedef QList<QXmlStreamEntityDeclaration> QXmlStreamEntityDeclarations;
207class Q_CORE_EXPORT QXmlStreamEntityResolver
209 Q_DISABLE_COPY_MOVE(QXmlStreamEntityResolver)
211 QXmlStreamEntityResolver() =
default;
212 virtual ~QXmlStreamEntityResolver();
217#if QT_CONFIG(xmlstreamreader)
218class Q_CORE_EXPORT QXmlStreamReader
220 QDOC_PROPERTY(
bool namespaceProcessing READ namespaceProcessing WRITE setNamespaceProcessing)
233 ProcessingInstruction
239#if QT_CORE_REMOVED_SINCE(6, 5)
242 explicit QXmlStreamReader(
const char *
data);
246 : QXmlStreamReader(
data, PrivateConstructorTag{}) { }
252#if QT_CORE_REMOVED_SINCE(6, 5)
255 void addData(
const char *
data);
266 bool readNextStartElement();
267 void skipCurrentElement();
272 void setNamespaceProcessing(
bool);
273 bool namespaceProcessing()
const;
275 inline bool isStartDocument()
const {
return tokenType() == StartDocument; }
276 inline bool isEndDocument()
const {
return tokenType() == EndDocument; }
277 inline bool isStartElement()
const {
return tokenType() == StartElement; }
278 inline bool isEndElement()
const {
return tokenType() == EndElement; }
279 inline bool isCharacters()
const {
return tokenType() == Characters; }
281 bool isCDATA()
const;
282 inline bool isComment()
const {
return tokenType() ==
Comment; }
283 inline bool isDTD()
const {
return tokenType() == DTD; }
284 inline bool isEntityReference()
const {
return tokenType() == EntityReference; }
285 inline bool isProcessingInstruction()
const {
return tokenType() == ProcessingInstruction; }
287 bool isStandaloneDocument()
const;
288 bool hasStandaloneDeclaration()
const;
292 qint64 lineNumber()
const;
293 qint64 columnNumber()
const;
294 qint64 characterOffset()
const;
296 QXmlStreamAttributes attributes()
const;
298 enum ReadElementTextBehaviour {
299 ErrorOnUnexpectedElement,
300 IncludeChildElements,
303 QString readElementText(ReadElementTextBehaviour behaviour = ErrorOnUnexpectedElement);
315 QXmlStreamNamespaceDeclarations namespaceDeclarations()
const;
316 void addExtraNamespaceDeclaration(
const QXmlStreamNamespaceDeclaration &extraNamespaceDeclaraction);
317 void addExtraNamespaceDeclarations(
const QXmlStreamNamespaceDeclarations &extraNamespaceDeclaractions);
318 QXmlStreamNotationDeclarations notationDeclarations()
const;
319 QXmlStreamEntityDeclarations entityDeclarations()
const;
324 int entityExpansionLimit()
const;
325 void setEntityExpansionLimit(
int limit);
329 UnexpectedElementError,
332 PrematureEndOfDocumentError
338 inline bool hasError()
const
343 void setEntityResolver(QXmlStreamEntityResolver *resolver);
344 QXmlStreamEntityResolver *entityResolver()
const;
347 struct PrivateConstructorTag { };
351 Q_DISABLE_COPY(QXmlStreamReader)
352 Q_DECLARE_PRIVATE(QXmlStreamReader)
353 QScopedPointer<QXmlStreamReaderPrivate> d_ptr;
358#if QT_CONFIG(xmlstreamwriter)
360class QXmlStreamWriterPrivate;
362class Q_CORE_EXPORT QXmlStreamWriter
364 QDOC_PROPERTY(
bool autoFormatting READ autoFormatting WRITE setAutoFormatting)
365 QDOC_PROPERTY(
int autoFormattingIndent READ autoFormattingIndent WRITE setAutoFormattingIndent)
370 explicit QXmlStreamWriter(
QString *
string);
376 void setAutoFormatting(
bool);
377 bool autoFormatting()
const;
379 void setAutoFormattingIndent(
int spacesOrTabs);
380 int autoFormattingIndent()
const;
382#if QT_CORE_REMOVED_SINCE(6,5)
390 void writeAttributes(
const QXmlStreamAttributes& attributes);
392#if QT_CORE_REMOVED_SINCE(6,5)
397 void writeDTD(
const QString &dtd);
399 void writeEmptyElement(
const QString &qualifiedName);
418 void writeEndDocument();
421#if QT_CORE_REMOVED_SINCE(6,5)
423 void writeNamespace(
const QString &namespaceUri,
const QString &prefix);
424 void writeDefaultNamespace(
const QString &namespaceUri);
432 void writeStartDocument();
433#if QT_CORE_REMOVED_SINCE(6,5)
434 void writeStartDocument(
const QString &version);
435 void writeStartDocument(
const QString &version,
bool standalone);
444#if QT_CONFIG(xmlstreamreader)
445 void writeCurrentToken(
const QXmlStreamReader &reader);
448 bool hasError()
const;
451 Q_DISABLE_COPY(QXmlStreamWriter)
452 Q_DECLARE_PRIVATE(QXmlStreamWriter)
453 QScopedPointer<QXmlStreamWriterPrivate> d_ptr;
IOBluetoothDevice * device
\inmodule QtCore \reentrant
constexpr QStringView left(qsizetype n) const noexcept
\macro QT_RESTRICTED_CAST_FROM_ASCII
list append(new Employee("Blackpool", "Stephen"))
Combined button and popup list for selecting options.
static void writeAttribute(QXmlStreamWriter *stream, const QVariant &attribute)
#define Q_DECLARE_EQUALITY_COMPARABLE(...)
constexpr bool operator!=(const timespec &t1, const timespec &t2)
DBusConnection const char DBusError * error
bool comparesEqual(const QDir &lhs, const QDir &rhs)
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
EGLOutputLayerEXT EGLint attribute
constexpr const T & qMax(const T &a, const T &b)
static bool isWhitespace(char c)
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLuint GLsizei const GLchar * message
const void * data_ptr(const QTransform &t)
bool operator==(const QRandomGenerator &rng1, const QRandomGenerator &rng2)
static QChar resolveEntity(QStringView entity)
#define Q_DECLARE_TYPEINFO(TYPE, FLAGS)
writeStartElement(qualifiedName)
[0]