aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qnx/qnxutils.h
blob: 3536fed63298af8f9a0ee96a2e29cc3f2945d915 (plain)
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
// Copyright (C) 2016 BlackBerry Limited. All rights reserved
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0

#pragma once

#include "qnxconstants.h"

#include <projectexplorer/abi.h>

#include <utils/environment.h>
#include <utils/qtcassert.h>
#include <utils/fileutils.h>

namespace Qnx::Internal {

class ConfigInstallInformation
{
public:
    QString path;
    QString name;
    QString host;
    QString target;
    QString version;
    QString installationXmlFilePath;

    bool isValid() { return !path.isEmpty() && !name.isEmpty() && !host.isEmpty()
                && !target.isEmpty() && !version.isEmpty() && !installationXmlFilePath.isEmpty(); }
};

class QnxTarget
{
public:
    QnxTarget(const Utils::FilePath &path, const ProjectExplorer::Abi &abi) :
        m_path(path), m_abi(abi)
    {
    }
    Utils::FilePath m_path;
    ProjectExplorer::Abi m_abi;
};

class QnxUtils
{
public:
    static QString cpuDirFromAbi(const ProjectExplorer::Abi &abi);
    static QString cpuDirShortDescription(const QString &cpuDir);
    static Utils::EnvironmentItems qnxEnvironmentFromEnvFile(const Utils::FilePath &filePath);
    static Utils::FilePath envFilePath(const Utils::FilePath &sdpPath);
    static QString defaultTargetVersion(const QString &sdpPath);
    static QList<ConfigInstallInformation> installedConfigs(const QString &configPath = QString());
    static Utils::EnvironmentItems qnxEnvironment(const Utils::FilePath &sdpPath);
    static QList<QnxTarget> findTargets(const Utils::FilePath &basePath);
    static ProjectExplorer::Abi convertAbi(const ProjectExplorer::Abi &abi);
    static ProjectExplorer::Abis convertAbis(const ProjectExplorer::Abis &abis);
};

} // Qnx::Internal