-
Notifications
You must be signed in to change notification settings - Fork 9
/
fileapireader.h
110 lines (81 loc) · 2.97 KB
/
fileapireader.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#pragma once
#include "builddirparameters.h"
#include "cmakebuildtarget.h"
#include "cmakeprojectnodes.h"
#include "fileapidataextractor.h"
#include <projectexplorer/rawprojectpart.h>
#include <projectexplorer/treescanner.h>
#include <utils/filesystemwatcher.h>
#include <QDateTime>
#include <QFuture>
#include <QObject>
#include <memory>
#include <optional>
namespace ProjectExplorer { class ProjectNode; }
namespace CMakeProjectManager::Internal {
class CMakeProcess;
class FileApiQtcData;
class FileApiReader : public QObject
{
Q_OBJECT
public:
FileApiReader();
~FileApiReader() override;
void setParameters(const BuildDirParameters &p);
void resetData();
void parse(bool forceCMakeRun,
bool forceInitialConfiguration,
bool forceExtraConfiguration,
bool debugging,
bool profiling);
void stop();
void stopCMakeRun();
bool isParsing() const;
QList<CMakeBuildTarget> takeBuildTargets(QString &errorMessage);
QSet<CMakeFileInfo> takeCMakeFileInfos(QString &errorMessage);
CMakeConfig takeParsedConfiguration(QString &errorMessage);
QString ctestPath() const;
virtual
ProjectExplorer::RawProjectParts createRawProjectParts(QString &errorMessage);
bool isMultiConfig() const;
bool usesAllCapsTargets() const;
int lastCMakeExitCode() const;
std::unique_ptr<CMakeProjectNode> rootProjectNode();
Utils::FilePath topCmakeFile() const;
signals:
void configurationStarted() const;
void dataAvailable(bool restoredFromBackup) const;
void dirty() const;
void errorOccurred(const QString &message) const;
void debuggingStarted() const;
protected:
void startState();
void endState(const Utils::FilePath &replyFilePath, bool restoredFromBackup);
void startCMakeState(const QStringList &configurationArguments);
void cmakeFinishedState(int exitCode);
void replyDirectoryHasChanged(const QString &directory) const;
void makeBackupConfiguration(bool store);
void writeConfigurationIntoBuildDirectory(const QStringList &configuration);
std::unique_ptr<CMakeProcess> m_cmakeProcess;
// cmake data:
CMakeConfig m_cache;
QSet<CMakeFileInfo> m_cmakeFiles;
QList<CMakeBuildTarget> m_buildTargets;
ProjectExplorer::RawProjectParts m_projectParts;
std::unique_ptr<CMakeProjectNode> m_rootProjectNode;
QString m_ctestPath;
bool m_isMultiConfig = false;
bool m_usesAllCapsTargets = false;
bool m_isPlain = false;
int m_lastCMakeExitCode = 0;
std::optional<QFuture<std::shared_ptr<FileApiQtcData>>> m_future;
// Update related:
bool m_isParsing = false;
BuildDirParameters m_parameters;
// Notification on changes outside of creator:
Utils::FileSystemWatcher m_watcher;
QDateTime m_lastReplyTimestamp;
};
} // CMakeProjectManager::Internal