1 /**************************************************************************
3 ** This file is part of Qt Creator
5 ** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
7 ** Contact: Nokia Corporation (qt-info@nokia.com)
11 ** This file contains pre-release code and may not be distributed.
12 ** You may use this file in accordance with the terms and conditions
13 ** contained in the Technology Preview License Agreement accompanying
16 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
25 ** In addition, as a special exception, Nokia gives you certain additional
26 ** rights. These rights are described in the Nokia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
29 ** If you have questions regarding the use of this file, please contact
30 ** Nokia at qt-info@nokia.com.
32 **************************************************************************/
34 #ifndef CE_SDK_HANDLER_H
35 #define CE_SDK_HANDLER_H
37 #include <projectexplorer/projectexplorer.h>
39 #include <QtCore/QStringList>
40 #include <QtCore/QDir>
42 #define VCINSTALL_MACRO "$(VCInstallDir)"
43 #define VSINSTALL_MACRO "$(VSInstallDir)"
49 namespace ProjectExplorer {
51 class PROJECTEXPLORER_EXPORT CeSdkInfo
55 inline QString name();
56 inline QString binPath();
57 inline QString includePath();
58 inline QString libPath();
59 void addToEnvironment(Utils::Environment &env);
60 inline bool isValid();
61 inline int majorVersion();
62 inline int minorVersion();
63 inline bool isSupported();
65 friend class CeSdkHandler;
74 inline QString CeSdkInfo::name() { return m_name; }
75 inline QString CeSdkInfo::binPath() { return m_bin; }
76 inline QString CeSdkInfo::includePath() { return m_include; }
77 inline QString CeSdkInfo::libPath() { return m_lib; }
78 inline bool CeSdkInfo::isValid() { return !m_name.isEmpty() && !m_bin.isEmpty() && !m_include.isEmpty() && !m_lib.isEmpty(); }
79 inline int CeSdkInfo::majorVersion() { return m_major; }
80 inline int CeSdkInfo::minorVersion() { return m_minor; }
81 inline bool CeSdkInfo::isSupported() { return m_major >= 5; }
83 class PROJECTEXPLORER_EXPORT CeSdkHandler
87 bool parse(const QString &path);
88 inline QList<CeSdkInfo> listAll() const;
89 CeSdkInfo find(const QString &name);
90 static QString platformName(const QString &qtpath);
92 inline QString fixPaths(QString path) const;
93 QList<CeSdkInfo> m_list;
98 inline QList<CeSdkInfo> CeSdkHandler::listAll() const
103 inline QString CeSdkHandler::fixPaths(QString path) const
105 return QDir::toNativeSeparators(QDir::cleanPath(path.replace(VCINSTALL_MACRO, VCInstallDir).replace(VSINSTALL_MACRO, VSInstallDir).replace(QLatin1String(";$(PATH)"), QLatin1String(""))));
108 } // namespace Qt4ProjectManager
110 #endif // CE_SDK_HANDLER_H