1// Copyright (C) 2016 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// Qt-Security score:significant reason:header-decls-only
4
5#ifndef QXMLUTILS_P_H
6#define QXMLUTILS_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists for the convenience
13// of qapplication_*.cpp, qwidget*.cpp and qfiledialog.cpp. This header
14// file may change from version to version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <QtCore/private/qglobal_p.h>
20#include <QtCore/qstring.h>
21
22QT_BEGIN_NAMESPACE
23
24class QString;
25class QChar;
26class QXmlCharRange;
27
28/*!
29 \internal
30 \short This class contains helper functions related to XML, for validating character classes,
31 productions in the XML specification, and so on.
32 */
33class Q_CORE_EXPORT QXmlUtils
34{
35public:
36 static bool isEncName(QStringView encName);
37 static bool isChar(const char32_t c);
38 static bool isNameChar(const QChar c);
39 static bool isLetter(const QChar c);
40 static bool isNCName(QStringView ncName);
41 static bool isPublicID(QStringView candidate);
42
43private:
44 typedef const QXmlCharRange *RangeIter;
45 static bool rangeContains(RangeIter begin, RangeIter end, const QChar c);
46 static bool isBaseChar(const QChar c);
47 static bool isDigit(const QChar c);
48 static bool isExtender(const QChar c);
49 static bool isIdeographic(const QChar c);
50 static bool isCombiningChar(const QChar c);
51};
52
53QT_END_NAMESPACE
54
55#endif
56

source code of qtbase/src/corelib/serialization/qxmlutils_p.h