1
/****************************************************************************
3
** Copyright (C) 1992-2005 Trolltech AS. All rights reserved.
5
** This file is part of the qmake application of the Qt Toolkit.
7
** This file may be distributed under the terms of the Q Public License
8
** as defined by Trolltech AS of Norway and appearing in the file
9
** LICENSE.QPL included in the packaging of this file.
11
** This file may be distributed and/or modified under the terms of the
12
** GNU General Public License version 2 as published by the Free Software
13
** Foundation and appearing in the file LICENSE.GPL included in the
14
** packaging of this file.
16
** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
17
** information about Qt Commercial License Agreements.
18
** See http://www.trolltech.com/qpl/ for QPL licensing information.
19
** See http://www.trolltech.com/gpl/ for GPL licensing information.
21
** Contact info@trolltech.com if any conditions of this licensing are
24
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
25
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27
****************************************************************************/
29
#ifndef __MAKEFILEDEPS_H__
30
#define __MAKEFILEDEPS_H__
32
#include "qstringlist.h"
33
#include "qfileinfo.h"
36
struct SourceDependChildren;
39
class QMakeLocalFileName {
41
mutable QString real_name, local_name;
43
QMakeLocalFileName() : is_null(1) { }
44
QMakeLocalFileName(const QString &);
45
bool isNull() const { return is_null; }
46
inline const QString &real() const { return real_name; }
47
const QString &local() const;
50
class QMakeSourceFileInfo
53
//quick project lookups
54
SourceFiles *files, *includes;
56
QList<QMakeLocalFileName> depdirs;
60
int spare_buffer_size;
61
char *getBuffer(int s);
64
bool findMocs(SourceFile *);
65
bool findDeps(SourceFile *);
66
void dependTreeWalker(SourceFile *, SourceDependChildren *);
72
virtual QMakeLocalFileName fixPathForFile(const QMakeLocalFileName &, bool forOpen=false);
73
virtual QMakeLocalFileName findFileForDep(const QMakeLocalFileName &, const QMakeLocalFileName &);
74
virtual QFileInfo findFileInfo(const QMakeLocalFileName &);
77
QMakeSourceFileInfo(const QString &cachefile="");
78
virtual ~QMakeSourceFileInfo();
80
QList<QMakeLocalFileName> dependencyPaths() const { return depdirs; }
81
void setDependencyPaths(const QList<QMakeLocalFileName> &);
83
enum DependencyMode { Recursive, NonRecursive };
84
inline void setDependencyMode(DependencyMode mode) { dep_mode = mode; }
85
inline DependencyMode dependencyMode() const { return dep_mode; }
87
enum SourceFileType { TYPE_UNKNOWN, TYPE_C, TYPE_UI, TYPE_QRC };
88
enum SourceFileSeek { SEEK_DEPS=0x01, SEEK_MOCS=0x02 };
89
void addSourceFiles(const QStringList &, uchar seek, SourceFileType type=TYPE_C);
90
void addSourceFile(const QString &, uchar seek, SourceFileType type=TYPE_C);
91
bool containsSourceFile(const QString &, SourceFileType type=TYPE_C);
93
int included(const QString &file);
94
QStringList dependencies(const QString &file);
96
bool mocable(const QString &file);
98
virtual QMap<QString, QStringList> getCacheVerification();
99
virtual bool verifyCache(const QMap<QString, QStringList> &);
100
void setCacheFile(const QString &cachefile); //auto caching
101
void loadCache(const QString &cf);
102
void saveCache(const QString &cf);
105
DependencyMode dep_mode;
108
#endif /* __MAKEFILEDEPS_H__ */