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 | |
21 | QT_BEGIN_NAMESPACE |
22 | |
23 | namespace QV4 { |
24 | |
25 | namespace CompiledData { |
26 | struct Unit; |
27 | } |
28 | |
29 | class CompilationUnitMapper |
30 | { |
31 | public: |
32 | CompiledData::Unit *get( |
33 | const QString &cacheFilePath, const QDateTime &sourceTimeStamp, QString *errorString); |
34 | static void invalidate(const QString &cacheFilePath); |
35 | |
36 | private: |
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 | |
49 | QT_END_NAMESPACE |
50 | |
51 | #endif // QV4COMPILATIONUNITMAPPER_H |
52 | |