Warning: That file was not part of the compilation database. It may have many parsing errors.
1 | /**************************************************************************** |
---|---|
2 | ** |
3 | ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). |
4 | ** Contact: http://www.qt-project.org/legal |
5 | ** |
6 | ** This file is part of the qmake application of the Qt Toolkit. |
7 | ** |
8 | ** $QT_BEGIN_LICENSE:LGPL$ |
9 | ** Commercial License Usage |
10 | ** Licensees holding valid commercial Qt licenses may use this file in |
11 | ** accordance with the commercial license agreement provided with the |
12 | ** Software or, alternatively, in accordance with the terms contained in |
13 | ** a written agreement between you and Digia. For licensing terms and |
14 | ** conditions see http://qt.digia.com/licensing. For further information |
15 | ** use the contact form at http://qt.digia.com/contact-us. |
16 | ** |
17 | ** 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. |
24 | ** |
25 | ** In addition, as a special exception, Digia gives you certain additional |
26 | ** rights. These rights are described in the Digia Qt LGPL Exception |
27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. |
28 | ** |
29 | ** GNU General Public License Usage |
30 | ** Alternatively, this file may be used under the terms of the GNU |
31 | ** General Public License version 3.0 as published by the Free Software |
32 | ** Foundation and appearing in the file LICENSE.GPL included in the |
33 | ** packaging of this file. Please review the following information to |
34 | ** ensure the GNU General Public License version 3.0 requirements will be |
35 | ** met: http://www.gnu.org/copyleft/gpl.html. |
36 | ** |
37 | ** |
38 | ** $QT_END_LICENSE$ |
39 | ** |
40 | ****************************************************************************/ |
41 | |
42 | #ifndef MAKEFILEDEPS_H |
43 | #define MAKEFILEDEPS_H |
44 | |
45 | #include <qstringlist.h> |
46 | #include <qfileinfo.h> |
47 | |
48 | QT_BEGIN_NAMESPACE |
49 | |
50 | struct SourceFile; |
51 | struct SourceDependChildren; |
52 | class SourceFiles; |
53 | |
54 | class QMakeLocalFileName { |
55 | uint is_null : 1; |
56 | mutable QString real_name, local_name; |
57 | public: |
58 | QMakeLocalFileName() : is_null(1) { } |
59 | QMakeLocalFileName(const QString &); |
60 | bool isNull() const { return is_null; } |
61 | inline const QString &real() const { return real_name; } |
62 | const QString &local() const; |
63 | |
64 | bool operator==(const QMakeLocalFileName &other) { |
65 | return (this->real_name == other.real_name); |
66 | } |
67 | bool operator!=(const QMakeLocalFileName &other) { |
68 | return !(*this == other); |
69 | } |
70 | }; |
71 | |
72 | class QMakeSourceFileInfo |
73 | { |
74 | private: |
75 | //quick project lookups |
76 | SourceFiles *files, *includes; |
77 | bool files_changed; |
78 | QList<QMakeLocalFileName> depdirs; |
79 | |
80 | //sleezy buffer code |
81 | char *spare_buffer; |
82 | int spare_buffer_size; |
83 | char *getBuffer(int s); |
84 | |
85 | //actual guts |
86 | bool findMocs(SourceFile *); |
87 | bool findDeps(SourceFile *); |
88 | void dependTreeWalker(SourceFile *, SourceDependChildren *); |
89 | |
90 | //cache |
91 | QString cachefile; |
92 | |
93 | protected: |
94 | virtual QMakeLocalFileName fixPathForFile(const QMakeLocalFileName &, bool forOpen=false); |
95 | virtual QMakeLocalFileName findFileForDep(const QMakeLocalFileName &, const QMakeLocalFileName &); |
96 | virtual QFileInfo findFileInfo(const QMakeLocalFileName &); |
97 | |
98 | public: |
99 | QMakeSourceFileInfo(const QString &cachefile=""); |
100 | virtual ~QMakeSourceFileInfo(); |
101 | |
102 | QList<QMakeLocalFileName> dependencyPaths() const { return depdirs; } |
103 | void setDependencyPaths(const QList<QMakeLocalFileName> &); |
104 | |
105 | enum DependencyMode { Recursive, NonRecursive }; |
106 | inline void setDependencyMode(DependencyMode mode) { dep_mode = mode; } |
107 | inline DependencyMode dependencyMode() const { return dep_mode; } |
108 | |
109 | enum SourceFileType { TYPE_UNKNOWN, TYPE_C, TYPE_UI, TYPE_QRC }; |
110 | enum SourceFileSeek { SEEK_DEPS=0x01, SEEK_MOCS=0x02 }; |
111 | void addSourceFiles(const QStringList &, uchar seek, SourceFileType type=TYPE_C); |
112 | void addSourceFile(const QString &, uchar seek, SourceFileType type=TYPE_C); |
113 | bool containsSourceFile(const QString &, SourceFileType type=TYPE_C); |
114 | |
115 | int included(const QString &file); |
116 | QStringList dependencies(const QString &file); |
117 | |
118 | bool mocable(const QString &file); |
119 | |
120 | virtual QMap<QString, QStringList> getCacheVerification(); |
121 | virtual bool verifyCache(const QMap<QString, QStringList> &); |
122 | void setCacheFile(const QString &cachefile); //auto caching |
123 | void loadCache(const QString &cf); |
124 | void saveCache(const QString &cf); |
125 | |
126 | private: |
127 | DependencyMode dep_mode; |
128 | }; |
129 | |
130 | QT_END_NAMESPACE |
131 | |
132 | #endif // MAKEFILEDEPS_H |
133 |
Warning: That file was not part of the compilation database. It may have many parsing errors.