1 | // SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. |
2 | // |
3 | // SPDX-License-Identifier: GPL-3.0-or-later |
4 | |
5 | #ifndef TOOLCHAINDATA_H |
6 | #define TOOLCHAINDATA_H |
7 | |
8 | #include <QSet> |
9 | #include <QMap> |
10 | #include <QMetaType> |
11 | |
12 | namespace { |
13 | static const QString kCCompilers{"C compilers" }; |
14 | static const QString kCXXCompilers{"C++ compilers" }; |
15 | static const QString kCCXXDebuggers{"C/C++ debuggers" }; |
16 | static const QString kCCXXBuildSystems{"C/C++ build systems" }; |
17 | static const QString kJDK{"JDK" }; |
18 | static const QString kMaven{"Maven" }; |
19 | static const QString kGradle{"Gradle" }; |
20 | static const QString kPython{"Python" }; |
21 | static const QString kNinja{"Ninja" }; |
22 | static const QString kJS{"JS" }; |
23 | |
24 | static const QString kNameItem{"name" }; |
25 | static const QString kPathItem{"path" }; |
26 | } |
27 | |
28 | class ToolChainData |
29 | { |
30 | public: |
31 | struct ToolChainParam |
32 | { |
33 | QString name; |
34 | QString path; |
35 | }; |
36 | using Params = QVector<ToolChainParam>; |
37 | |
38 | // ToolChain type & Parameters. |
39 | using ToolChains = QMap<QString, Params>; |
40 | |
41 | ToolChainData(); |
42 | |
43 | const ToolChains &getToolChanins() const; |
44 | bool readToolChainData(QString &retMsg); |
45 | |
46 | private: |
47 | bool readToolChain(QString &filePath); |
48 | ToolChains toolChains; |
49 | }; |
50 | |
51 | Q_DECLARE_METATYPE(ToolChainData::ToolChainParam); |
52 | |
53 | #endif // TOOLCHAINDATA_H |
54 | |