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
12namespace {
13static const QString kCCompilers{"C compilers"};
14static const QString kCXXCompilers{"C++ compilers"};
15static const QString kCCXXDebuggers{"C/C++ debuggers"};
16static const QString kCCXXBuildSystems{"C/C++ build systems"};
17static const QString kJDK{"JDK"};
18static const QString kMaven{"Maven"};
19static const QString kGradle{"Gradle"};
20static const QString kPython{"Python"};
21static const QString kNinja{"Ninja"};
22static const QString kJS{"JS"};
23
24static const QString kNameItem{"name"};
25static const QString kPathItem{"path"};
26}
27
28class ToolChainData
29{
30public:
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
46private:
47 bool readToolChain(QString &filePath);
48 ToolChains toolChains;
49};
50
51Q_DECLARE_METATYPE(ToolChainData::ToolChainParam);
52
53#endif // TOOLCHAINDATA_H
54