-rw-r--r-- | qmake/project.h | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/qmake/project.h b/qmake/project.h index 201e63c..ec19f0c 100644 --- a/qmake/project.h +++ b/qmake/project.h | |||
@@ -1,114 +1,114 @@ | |||
1 | /**************************************************************************** | 1 | /**************************************************************************** |
2 | ** $Id$ | 2 | ** $Id$ |
3 | ** | 3 | ** |
4 | ** Definition of ________ class. | 4 | ** Definition of ________ class. |
5 | ** | 5 | ** |
6 | ** Created : 970521 | 6 | ** Created : 970521 |
7 | ** | 7 | ** |
8 | ** Copyright (C) 1992-2000 Trolltech AS. All rights reserved. | 8 | ** Copyright (C) 1992-2002 Trolltech AS. All rights reserved. |
9 | ** | 9 | ** |
10 | ** This file is part of the network module of the Qt GUI Toolkit. | 10 | ** This file is part of the network module of the Qt GUI Toolkit. |
11 | ** | 11 | ** |
12 | ** This file may be distributed under the terms of the Q Public License | 12 | ** This file may be distributed under the terms of the Q Public License |
13 | ** as defined by Trolltech AS of Norway and appearing in the file | 13 | ** as defined by Trolltech AS of Norway and appearing in the file |
14 | ** LICENSE.QPL included in the packaging of this file. | 14 | ** LICENSE.QPL included in the packaging of this file. |
15 | ** | 15 | ** |
16 | ** This file may be distributed and/or modified under the terms of the | 16 | ** This file may be distributed and/or modified under the terms of the |
17 | ** GNU General Public License version 2 as published by the Free Software | 17 | ** GNU General Public License version 2 as published by the Free Software |
18 | ** Foundation and appearing in the file LICENSE.GPL included in the | 18 | ** Foundation and appearing in the file LICENSE.GPL included in the |
19 | ** packaging of this file. | 19 | ** packaging of this file. |
20 | ** | 20 | ** |
21 | ** Licensees holding valid Qt Enterprise Edition licenses may use this | 21 | ** Licensees holding valid Qt Enterprise Edition licenses may use this |
22 | ** file in accordance with the Qt Commercial License Agreement provided | 22 | ** file in accordance with the Qt Commercial License Agreement provided |
23 | ** with the Software. | 23 | ** with the Software. |
24 | ** | 24 | ** |
25 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 25 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
26 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 26 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
27 | ** | 27 | ** |
28 | ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for | 28 | ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for |
29 | ** information about Qt Commercial License Agreements. | 29 | ** information about Qt Commercial License Agreements. |
30 | ** See http://www.trolltech.com/qpl/ for QPL licensing information. | 30 | ** See http://www.trolltech.com/qpl/ for QPL licensing information. |
31 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 31 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
32 | ** | 32 | ** |
33 | ** Contact info@trolltech.com if any conditions of this licensing are | 33 | ** Contact info@trolltech.com if any conditions of this licensing are |
34 | ** not clear to you. | 34 | ** not clear to you. |
35 | ** | 35 | ** |
36 | **********************************************************************/ | 36 | **********************************************************************/ |
37 | #ifndef __QMAKE_H__ | 37 | #ifndef __PROJECT_H__ |
38 | #define __QMAKE_H__ | 38 | #define __PROJECT_H__ |
39 | 39 | ||
40 | #include <qstringlist.h> | 40 | #include <qstringlist.h> |
41 | #include <qstring.h> | 41 | #include <qstring.h> |
42 | #include <qmap.h> | 42 | #include <qmap.h> |
43 | 43 | ||
44 | class QMakeProject | 44 | class QMakeProject |
45 | { | 45 | { |
46 | enum TestStatus { TestNone, TestFound, TestSeek } test_status; | 46 | enum TestStatus { TestNone, TestFound, TestSeek } test_status; |
47 | int scope_block, scope_flag; | 47 | int scope_block, scope_flag; |
48 | 48 | ||
49 | QString pfile, cfile; | 49 | QString pfile, cfile; |
50 | QMap<QString, QStringList> vars, base_vars, cache; | 50 | QMap<QString, QStringList> vars, base_vars, cache; |
51 | bool parse(QString text, QMap<QString, QStringList> &place); | 51 | bool parse(const QString &text, QMap<QString, QStringList> &place); |
52 | bool doProjectTest(QString func, const QString ¶ms, QMap<QString, QStringList> &place); | 52 | bool doProjectTest(const QString &func, const QString ¶ms, QMap<QString, QStringList> &place); |
53 | bool doProjectTest(QString func, QStringList args, QMap<QString, QStringList> &place); | 53 | bool doProjectTest(const QString &func, QStringList args, QMap<QString, QStringList> &place); |
54 | bool doProjectCheckReqs(const QStringList &deps, QMap<QString, QStringList> &place); | 54 | bool doProjectCheckReqs(const QStringList &deps, QMap<QString, QStringList> &place); |
55 | QString doVariableReplace(QString &str, const QMap<QString, QStringList> &place); | 55 | QString doVariableReplace(QString &str, const QMap<QString, QStringList> &place); |
56 | 56 | ||
57 | public: | 57 | public: |
58 | QMakeProject(); | 58 | QMakeProject(); |
59 | 59 | ||
60 | bool read(QString project, QString pwd); | 60 | bool read(const QString &project, const QString &pwd, bool just_project=FALSE); |
61 | QString projectFile(); | 61 | QString projectFile(); |
62 | QString configFile(); | 62 | QString configFile(); |
63 | 63 | ||
64 | bool isEmpty(const QString &v); | 64 | bool isEmpty(const QString &v); |
65 | QStringList &values(const QString &v); | 65 | QStringList &values(const QString &v); |
66 | QString first(const QString &v); | 66 | QString first(const QString &v); |
67 | QMap<QString, QStringList> &variables(); | 67 | QMap<QString, QStringList> &variables(); |
68 | bool isActiveConfig(const QString &x); | 68 | bool isActiveConfig(const QString &x, bool regex=FALSE); |
69 | 69 | ||
70 | protected: | 70 | protected: |
71 | friend class MakefileGenerator; | 71 | friend class MakefileGenerator; |
72 | bool read(QString file, QMap<QString, QStringList> &place); | 72 | bool read(const QString &file, QMap<QString, QStringList> &place); |
73 | 73 | ||
74 | }; | 74 | }; |
75 | 75 | ||
76 | inline QString QMakeProject::projectFile() | 76 | inline QString QMakeProject::projectFile() |
77 | { | 77 | { |
78 | #if defined(Q_CC_SUN) && (__SUNPRO_CC == 0x500) || defined(Q_CC_HP) | 78 | #if defined(Q_CC_SUN) && (__SUNPRO_CC == 0x500) || defined(Q_CC_HP) |
79 | // workaround for Sun WorkShop 5.0 bug fixed in Forte 6 | 79 | // workaround for Sun WorkShop 5.0 bug fixed in Forte 6 |
80 | if (pfile == "-") | 80 | if (pfile == "-") |
81 | return QString("(stdin)"); | 81 | return QString("(stdin)"); |
82 | else | 82 | else |
83 | return pfile; | 83 | return pfile; |
84 | #else | 84 | #else |
85 | return pfile == "-" ? QString("(stdin)") : pfile; | 85 | return pfile == "-" ? QString("(stdin)") : pfile; |
86 | #endif | 86 | #endif |
87 | } | 87 | } |
88 | 88 | ||
89 | inline QString QMakeProject::configFile() | 89 | inline QString QMakeProject::configFile() |
90 | { return cfile; } | 90 | { return cfile; } |
91 | 91 | ||
92 | inline bool QMakeProject::isEmpty(const QString &v) | 92 | inline bool QMakeProject::isEmpty(const QString &v) |
93 | { return !vars.contains(v) || vars[v].isEmpty(); } | 93 | { return !vars.contains(v) || vars[v].isEmpty(); } |
94 | 94 | ||
95 | inline QStringList &QMakeProject::values(const QString &v) | 95 | inline QStringList &QMakeProject::values(const QString &v) |
96 | { return vars[v]; } | 96 | { return vars[v]; } |
97 | 97 | ||
98 | inline QString QMakeProject::first(const QString &v) | 98 | inline QString QMakeProject::first(const QString &v) |
99 | { | 99 | { |
100 | #if defined(Q_CC_SUN) && (__SUNPRO_CC == 0x500) || defined(Q_CC_HP) | 100 | #if defined(Q_CC_SUN) && (__SUNPRO_CC == 0x500) || defined(Q_CC_HP) |
101 | // workaround for Sun WorkShop 5.0 bug fixed in Forte 6 | 101 | // workaround for Sun WorkShop 5.0 bug fixed in Forte 6 |
102 | if (isEmpty(v)) | 102 | if (isEmpty(v)) |
103 | return QString(""); | 103 | return QString(""); |
104 | else | 104 | else |
105 | return vars[v].first(); | 105 | return vars[v].first(); |
106 | #else | 106 | #else |
107 | return isEmpty(v) ? QString("") : vars[v].first(); | 107 | return isEmpty(v) ? QString("") : vars[v].first(); |
108 | #endif | 108 | #endif |
109 | } | 109 | } |
110 | 110 | ||
111 | inline QMap<QString, QStringList> &QMakeProject::variables() | 111 | inline QMap<QString, QStringList> &QMakeProject::variables() |
112 | { return vars; } | 112 | { return vars; } |
113 | 113 | ||
114 | #endif /* __QMAKE_H__ */ | 114 | #endif /* __PROJECT_H__ */ |