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
4#ifndef QV4COMPILATIONUNITMAPPER_H
5#define QV4COMPILATIONUNITMAPPER_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <private/qv4global_p.h>
19#include <QFile>
20
21QT_BEGIN_NAMESPACE
22
23namespace QV4 {
24
25namespace CompiledData {
26struct Unit;
27}
28
29class CompilationUnitMapper
30{
31public:
32 CompiledData::Unit *get(
33 const QString &cacheFilePath, const QDateTime &sourceTimeStamp, QString *errorString);
34 static void invalidate(const QString &cacheFilePath);
35
36private:
37 CompiledData::Unit *open(
38 const QString &cacheFilePath, const QDateTime &sourceTimeStamp, QString *errorString);
39 void close();
40
41#if defined(Q_OS_UNIX)
42 size_t length = 0;
43#endif
44 void *dataPtr = nullptr;
45};
46
47}
48
49QT_END_NAMESPACE
50
51#endif // QV4COMPILATIONUNITMAPPER_H
52

source code of qtdeclarative/src/qml/jsruntime/qv4compilationunitmapper_p.h