Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qqmlscriptblob_p.h
Go to the documentation of this file.
1// Copyright (C) 2019 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
4
5#ifndef QQMLSCRIPTBLOB_P_H
6#define QQMLSCRIPTBLOB_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 purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <private/qqmlnotifyingblob_p.h>
20#include <private/qqmlscriptdata_p.h>
21#include <private/qqmltypeloader_p.h>
22
25
26class Q_AUTOTEST_EXPORT QQmlScriptBlob : public QQmlNotifyingBlob
27{
28private:
29 friend class QQmlTypeLoader;
30
31public:
32 enum class IsESModule { No, Yes };
33 QQmlScriptBlob(const QUrl &url, QQmlTypeLoader *typeLoader, IsESModule isESModule);
34 ~QQmlScriptBlob() override;
35
36 struct ScriptReference
37 {
38 QV4::CompiledData::Location location;
39 QString qualifier;
40 QString nameSpace;
41 QQmlRefPointer<QQmlScriptBlob> script;
42 };
43
44 QQmlRefPointer<QQmlScriptData> scriptData() const
45 {
46 return m_scriptData;
47 }
48
49protected:
50 void dataReceived(const SourceCodeData &) override;
51 void initializeFromCachedUnit(const QQmlPrivate::CachedQmlUnit *unit) override;
52 void done() override;
53
54 QString stringAt(int index) const override;
55
56private:
57 void scriptImported(const QQmlRefPointer<QQmlScriptBlob> &blob, const QV4::CompiledData::Location &location, const QString &qualifier, const QString &nameSpace) override;
58 void initializeFromCompilationUnit(QQmlRefPointer<QV4::CompiledData::CompilationUnit> &&cu);
59
60 QList<ScriptReference> m_scripts;
61 QQmlRefPointer<QQmlScriptData> m_scriptData;
62 const bool m_isModule = false;
63};
64
65QT_END_NAMESPACE
66
67#endif // QQMLSCRIPTBLOB_P_H
QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQIORing)