From 0e78e5080262b8fa7a86f7cd0c8716839db048f6 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 5 Sep 2012 18:29:19 +0200 Subject: port qmake to qt creator's qmake language evaluator this is a monster commit which does the following things: - import the evaluator as-is from qt creator into qmake/library/ - integrate it into qmake's makefiles - overwrite proitems.h with actual special types - remove the parts of Option which are redundant with QMakeGlobals - make QMakeProperty a singleton owned by Option::globals. the dynamic handling so far made no sense. - make QMakeProject a subclass of QMakeEvaluator, with relatively few extensions the changes to existing qmake code outside project.* and option.* are minor. implementing the changes gradually would mean changing a lot of code which will be just replaced in the next commit, so i'm not wasting my time on it. Change-Id: I9746650423b8c5b3fbd8c3979a73228982a46195 Reviewed-by: Qt Doc Bot Reviewed-by: Joerg Bornemann --- qmake/library/ioutils.h | 83 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 qmake/library/ioutils.h (limited to 'qmake/library/ioutils.h') diff --git a/qmake/library/ioutils.h b/qmake/library/ioutils.h new file mode 100644 index 0000000000..35410e3db5 --- /dev/null +++ b/qmake/library/ioutils.h @@ -0,0 +1,83 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the qmake application of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef IOUTILS_H +#define IOUTILS_H + +#include + +QT_BEGIN_NAMESPACE + +namespace QMakeInternal { + +/*! + This class provides replacement functionality for QFileInfo, QFile & QDir, + as these are abysmally slow. +*/ +class IoUtils { +public: + enum FileType { + FileNotFound = 0, + FileIsRegular = 1, + FileIsDir = 2 + }; + + static FileType fileType(const QString &fileName); + static bool exists(const QString &fileName) { return fileType(fileName) != FileNotFound; } + static bool isRelativePath(const QString &fileName); + static bool isAbsolutePath(const QString &fileName) { return !isRelativePath(fileName); } + static QStringRef fileName(const QString &fileName); // Requires normalized path + static QString resolvePath(const QString &baseDir, const QString &fileName); + static QString shellQuoteUnix(const QString &arg); + static QString shellQuoteWin(const QString &arg); + static QString shellQuote(const QString &arg) +#ifdef Q_OS_UNIX + { return shellQuoteUnix(arg); } +#else + { return shellQuoteWin(arg); } +#endif +}; + +} // namespace ProFileEvaluatorInternal + +QT_END_NAMESPACE + +#endif // IOUTILS_H -- cgit v1.2.3