| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/qml/qqmldirparser_p.h |
| Source code | Switch to Preprocessed file |
| Line | Source | Count |
|---|---|---|
| 1 | /**************************************************************************** | - |
| 2 | ** | - |
| 3 | ** Copyright (C) 2016 The Qt Company Ltd. | - |
| 4 | ** Contact: https://www.qt.io/licensing/ | - |
| 5 | ** | - |
| 6 | ** This file is part of the QtQml module of the Qt Toolkit. | - |
| 7 | ** | - |
| 8 | ** $QT_BEGIN_LICENSE:LGPL$ | - |
| 9 | ** Commercial License Usage | - |
| 10 | ** Licensees holding valid commercial Qt licenses may use this file in | - |
| 11 | ** accordance with the commercial license agreement provided with the | - |
| 12 | ** Software or, alternatively, in accordance with the terms contained in | - |
| 13 | ** a written agreement between you and The Qt Company. For licensing terms | - |
| 14 | ** and conditions see https://www.qt.io/terms-conditions. For further | - |
| 15 | ** information use the contact form at https://www.qt.io/contact-us. | - |
| 16 | ** | - |
| 17 | ** GNU Lesser General Public License Usage | - |
| 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser | - |
| 19 | ** General Public License version 3 as published by the Free Software | - |
| 20 | ** Foundation and appearing in the file LICENSE.LGPL3 included in the | - |
| 21 | ** packaging of this file. Please review the following information to | - |
| 22 | ** ensure the GNU Lesser General Public License version 3 requirements | - |
| 23 | ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. | - |
| 24 | ** | - |
| 25 | ** GNU General Public License Usage | - |
| 26 | ** Alternatively, this file may be used under the terms of the GNU | - |
| 27 | ** General Public License version 2.0 or (at your option) the GNU General | - |
| 28 | ** Public license version 3 or any later version approved by the KDE Free | - |
| 29 | ** Qt Foundation. The licenses are as published by the Free Software | - |
| 30 | ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 | - |
| 31 | ** included in the packaging of this file. Please review the following | - |
| 32 | ** information to ensure the GNU General Public License requirements will | - |
| 33 | ** be met: https://www.gnu.org/licenses/gpl-2.0.html and | - |
| 34 | ** https://www.gnu.org/licenses/gpl-3.0.html. | - |
| 35 | ** | - |
| 36 | ** $QT_END_LICENSE$ | - |
| 37 | ** | - |
| 38 | ****************************************************************************/ | - |
| 39 | - | |
| 40 | #ifndef QQMLDIRPARSER_P_H | - |
| 41 | #define QQMLDIRPARSER_P_H | - |
| 42 | - | |
| 43 | // | - |
| 44 | // W A R N I N G | - |
| 45 | // ------------- | - |
| 46 | // | - |
| 47 | // This file is not part of the Qt API. It exists purely as an | - |
| 48 | // implementation detail. This header file may change from version to | - |
| 49 | // version without notice, or even be removed. | - |
| 50 | // | - |
| 51 | // We mean it. | - |
| 52 | // | - |
| 53 | - | |
| 54 | #include <QtCore/QUrl> | - |
| 55 | #include <QtCore/QHash> | - |
| 56 | #include <QtCore/QDebug> | - |
| 57 | #include <private/qqmljsengine_p.h> | - |
| 58 | #include <private/qv4global_p.h> | - |
| 59 | - | |
| 60 | QT_BEGIN_NAMESPACE | - |
| 61 | - | |
| 62 | class QQmlError; | - |
| 63 | class QQmlEngine; | - |
| 64 | class Q_QML_PRIVATE_EXPORT QQmlDirParser | - |
| 65 | { | - |
| 66 | public: | - |
| 67 | QQmlDirParser(); | - |
| 68 | ~QQmlDirParser(); | - |
| 69 | - | |
| 70 | bool parse(const QString &source); | - |
| 71 | - | |
| 72 | bool hasError() const; | - |
| 73 | void setError(const QQmlError &); | - |
| 74 | QList<QQmlError> errors(const QString &uri) const; | - |
| 75 | - | |
| 76 | QString typeNamespace() const; | - |
| 77 | void setTypeNamespace(const QString &s); | - |
| 78 | - | |
| 79 | struct Plugin | - |
| 80 | { | - |
| 81 | Plugin() {} | - |
| 82 | - | |
| 83 | Plugin(const QString &name, const QString &path) | - |
| 84 | : name(name), path(path) {} executed 7633 times by 137 tests: end of blockExecuted by:
| 7633 |
| 85 | - | |
| 86 | QString name; | - |
| 87 | QString path; | - |
| 88 | }; | - |
| 89 | - | |
| 90 | struct Component | - |
| 91 | { | - |
| 92 | Component() {} | - |
| 93 | - | |
| 94 | Component(const QString &typeName, const QString &fileName, int majorVersion, int minorVersion) | - |
| 95 | : typeName(typeName), fileName(fileName), majorVersion(majorVersion), minorVersion(minorVersion), | - |
| 96 | internal(false), singleton(false) {} executed 440 times by 16 tests: end of blockExecuted by:
| 440 |
| 97 | - | |
| 98 | QString typeName; | - |
| 99 | QString fileName; | - |
| 100 | int majorVersion = 0; | - |
| 101 | int minorVersion = 0; | - |
| 102 | bool internal = false; | - |
| 103 | bool singleton = false; | - |
| 104 | }; | - |
| 105 | - | |
| 106 | struct Script | - |
| 107 | { | - |
| 108 | Script() {} | - |
| 109 | - | |
| 110 | Script(const QString &nameSpace, const QString &fileName, int majorVersion, int minorVersion) | - |
| 111 | : nameSpace(nameSpace), fileName(fileName), majorVersion(majorVersion), minorVersion(minorVersion) {} executed 10 times by 2 tests: end of blockExecuted by:
| 10 |
| 112 | - | |
| 113 | QString nameSpace; | - |
| 114 | QString fileName; | - |
| 115 | int majorVersion = 0; | - |
| 116 | int minorVersion = 0; | - |
| 117 | }; | - |
| 118 | - | |
| 119 | QHash<QString,Component> components() const; | - |
| 120 | QHash<QString,Component> dependencies() const; | - |
| 121 | QList<Script> scripts() const; | - |
| 122 | QList<Plugin> plugins() const; | - |
| 123 | bool designerSupported() const; | - |
| 124 | - | |
| 125 | #ifdef QT_CREATOR | - |
| 126 | struct TypeInfo | - |
| 127 | { | - |
| 128 | TypeInfo() {} | - |
| 129 | TypeInfo(const QString &fileName) | - |
| 130 | : fileName(fileName) {} | - |
| 131 | - | |
| 132 | QString fileName; | - |
| 133 | }; | - |
| 134 | - | |
| 135 | QList<TypeInfo> typeInfos() const; | - |
| 136 | #endif | - |
| 137 | - | |
| 138 | QString className() const; | - |
| 139 | - | |
| 140 | private: | - |
| 141 | bool maybeAddComponent(const QString &typeName, const QString &fileName, const QString &version, QHash<QString,Component> &hash, int lineNumber = -1, bool multi = true); | - |
| 142 | void reportError(quint16 line, quint16 column, const QString &message); | - |
| 143 | - | |
| 144 | private: | - |
| 145 | QList<QQmlJS::DiagnosticMessage> _errors; | - |
| 146 | QString _typeNamespace; | - |
| 147 | QHash<QString,Component> _components; // multi hash | - |
| 148 | QHash<QString,Component> _dependencies; | - |
| 149 | QList<Script> _scripts; | - |
| 150 | QList<Plugin> _plugins; | - |
| 151 | bool _designerSupported; | - |
| 152 | #ifdef QT_CREATOR | - |
| 153 | QList<TypeInfo> _typeInfos; | - |
| 154 | #endif | - |
| 155 | QString _className; | - |
| 156 | }; | - |
| 157 | - | |
| 158 | typedef QHash<QString,QQmlDirParser::Component> QQmlDirComponents; | - |
| 159 | typedef QList<QQmlDirParser::Script> QQmlDirScripts; | - |
| 160 | typedef QList<QQmlDirParser::Plugin> QQmlDirPlugins; | - |
| 161 | - | |
| 162 | QDebug &operator<< (QDebug &, const QQmlDirParser::Component &); | - |
| 163 | QDebug &operator<< (QDebug &, const QQmlDirParser::Script &); | - |
| 164 | - | |
| 165 | QT_END_NAMESPACE | - |
| 166 | - | |
| 167 | #endif // QQMLDIRPARSER_P_H | - |
| Source code | Switch to Preprocessed file |