Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qdomhelpers_p.h
Go to the documentation of this file.
1// Copyright (C) 2021 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3#ifndef QDOMHELPERS_P_H
4#define QDOMHELPERS_P_H
5
6#include <qcoreapplication.h>
7#include <qdom.h>
8#include <private/qglobal_p.h>
9
11
12//
13// W A R N I N G
14// -------------
15//
16// This file is not part of the Qt API. It exists for the convenience of
17// qxml.cpp and qdom.cpp. This header file may change from version to version without
18// notice, or even be removed.
19//
20// We mean it.
21//
22
24class QDomNodePrivate;
25class QXmlStreamReader;
26class QXmlStreamAttributes;
27
28/**************************************************************
29 *
30 * QDomBuilder
31 *
32 **************************************************************/
33
35{
36public:
37 QDomBuilder(QDomDocumentPrivate *d, QXmlStreamReader *r, QDomDocument::ParseOptions options);
39
40 bool endDocument();
41 bool startElement(const QString &nsURI, const QString &qName, const QXmlStreamAttributes &atts);
42 bool endElement();
43 bool characters(const QString &characters, bool cdata = false);
44 bool processingInstruction(const QString &target, const QString &data);
45 bool skippedEntity(const QString &name);
46 bool startEntity(const QString &name);
47 bool endEntity();
48 bool startDTD(const QString &name, const QString &publicId, const QString &systemId);
49 bool parseDTD(const QString &dtd);
50 bool comment(const QString &characters);
51 bool externalEntityDecl(const QString &name, const QString &publicId, const QString &systemId);
52 bool notationDecl(const QString &name, const QString &publicId, const QString &systemId);
53 bool unparsedEntityDecl(const QString &name, const QString &publicId, const QString &systemId,
54 const QString &notationName);
55
56 void fatalError(const QString &message);
57 QDomDocument::ParseResult result() const { return parseResult; }
58
61
62private:
63 QString dtdInternalSubset(const QString &dtd);
64
65 QDomDocument::ParseResult parseResult;
67 QDomNodePrivate *node;
68 QXmlStreamReader *reader;
69 QString entityName;
70 QDomDocument::ParseOptions parseOptions;
71};
72
73/**************************************************************
74 *
75 * QDomParser
76 *
77 **************************************************************/
78
80{
82public:
83 QDomParser(QDomDocumentPrivate *d, QXmlStreamReader *r, QDomDocument::ParseOptions options);
84
85 bool parse();
86 QDomDocument::ParseResult result() const { return domBuilder.result(); }
87
88private:
89 bool parseProlog();
90 bool parseBody();
91 bool parseMarkupDecl();
92
93 QXmlStreamReader *reader;
94 QDomBuilder domBuilder;
95};
96
98
99#endif // QDOMHELPERS_P_H
bool startElement(const QString &nsURI, const QString &qName, const QXmlStreamAttributes &atts)
QDomBuilder(QDomDocumentPrivate *d, QXmlStreamReader *r, QDomDocument::ParseOptions options)
bool startDTD(const QString &name, const QString &publicId, const QString &systemId)
bool skippedEntity(const QString &name)
QDomDocument::ParseResult result() const
bool processingInstruction(const QString &target, const QString &data)
bool startEntity(const QString &name)
void fatalError(const QString &message)
bool endDocument()
bool externalEntityDecl(const QString &name, const QString &publicId, const QString &systemId)
bool parseDTD(const QString &dtd)
bool unparsedEntityDecl(const QString &name, const QString &publicId, const QString &systemId, const QString &notationName)
bool endElement()
bool preserveSpacingOnlyNodes() const
bool comment(const QString &characters)
bool notationDecl(const QString &name, const QString &publicId, const QString &systemId)
QDomDocument::ParseResult result() const
QDomParser(QDomDocumentPrivate *d, QXmlStreamReader *r, QDomDocument::ParseOptions options)
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
Combined button and popup list for selecting options.
#define Q_DECLARE_TR_FUNCTIONS(context)
GLboolean r
[2]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum target
GLuint GLsizei const GLchar * message
GLuint name
QList< QChar > characters
The struct is used to store the result of QDomDocument::setContent().
Definition qdom.h:279