forked from qt-creator/qt-creator
ProfileEvaluator::Option => ProfileOption
makes forward delcs in headers possible
This commit is contained in:
@@ -67,7 +67,7 @@ private:
|
||||
private:
|
||||
QMap<QString, ProFile *> m_includeFiles;
|
||||
QList<ProFile *> m_proFiles;
|
||||
ProFileEvaluator::Option m_option;
|
||||
ProFileOption m_option;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
@@ -85,11 +85,12 @@ static void clearFunctions(ProFileEvaluator::FunctionDefs *defs)
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Option
|
||||
// ProFileOption
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
|
||||
ProFileEvaluator::Option::Option()
|
||||
// ProFileOption
|
||||
ProFileOption::ProFileOption()
|
||||
{
|
||||
#ifdef Q_OS_WIN
|
||||
dirlist_sep = QLatin1Char(';');
|
||||
@@ -113,12 +114,12 @@ ProFileEvaluator::Option::Option()
|
||||
field_sep = QLatin1String(" ");
|
||||
}
|
||||
|
||||
ProFileEvaluator::Option::~Option()
|
||||
ProFileOption::~ProFileOption()
|
||||
{
|
||||
clearFunctions(&base_functions);
|
||||
}
|
||||
|
||||
QString ProFileEvaluator::Option::field_sep;
|
||||
QString ProFileOption::field_sep;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
@@ -129,7 +130,7 @@ QString ProFileEvaluator::Option::field_sep;
|
||||
class ProFileEvaluator::Private : public AbstractProItemVisitor
|
||||
{
|
||||
public:
|
||||
Private(ProFileEvaluator *q_, ProFileEvaluator::Option *option);
|
||||
Private(ProFileEvaluator *q_, ProFileOption *option);
|
||||
~Private();
|
||||
|
||||
ProFileEvaluator *q;
|
||||
@@ -248,7 +249,7 @@ public:
|
||||
QStringList m_removeUserConfigCmdArgs;
|
||||
bool m_parsePreAndPostFiles;
|
||||
|
||||
Option *m_option;
|
||||
ProFileOption *m_option;
|
||||
};
|
||||
|
||||
#if !defined(__GNUC__) || __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 3)
|
||||
@@ -256,7 +257,7 @@ Q_DECLARE_TYPEINFO(ProFileEvaluator::Private::State, Q_PRIMITIVE_TYPE);
|
||||
Q_DECLARE_TYPEINFO(ProFileEvaluator::Private::ProLoop, Q_MOVABLE_TYPE);
|
||||
#endif
|
||||
|
||||
ProFileEvaluator::Private::Private(ProFileEvaluator *q_, ProFileEvaluator::Option *option)
|
||||
ProFileEvaluator::Private::Private(ProFileEvaluator *q_, ProFileOption *option)
|
||||
: q(q_), m_option(option)
|
||||
{
|
||||
// Configuration, more or less
|
||||
@@ -1315,22 +1316,22 @@ QStringList ProFileEvaluator::Private::qmakeFeaturePaths() const
|
||||
QString features_concat = QLatin1String("/features");
|
||||
QStringList concat;
|
||||
switch (m_option->target_mode) {
|
||||
case Option::TARG_MACX_MODE:
|
||||
case ProFileOption::TARG_MACX_MODE:
|
||||
concat << QLatin1String("/features/mac");
|
||||
concat << QLatin1String("/features/macx");
|
||||
concat << QLatin1String("/features/unix");
|
||||
break;
|
||||
case Option::TARG_UNIX_MODE:
|
||||
case ProFileOption::TARG_UNIX_MODE:
|
||||
concat << QLatin1String("/features/unix");
|
||||
break;
|
||||
case Option::TARG_WIN_MODE:
|
||||
case ProFileOption::TARG_WIN_MODE:
|
||||
concat << QLatin1String("/features/win32");
|
||||
break;
|
||||
case Option::TARG_MAC9_MODE:
|
||||
case ProFileOption::TARG_MAC9_MODE:
|
||||
concat << QLatin1String("/features/mac");
|
||||
concat << QLatin1String("/features/mac9");
|
||||
break;
|
||||
case Option::TARG_QNX6_MODE:
|
||||
case ProFileOption::TARG_QNX6_MODE:
|
||||
concat << QLatin1String("/features/qnx6");
|
||||
concat << QLatin1String("/features/unix");
|
||||
break;
|
||||
@@ -1431,7 +1432,7 @@ QString ProFileEvaluator::Private::currentDirectory() const
|
||||
|
||||
void ProFileEvaluator::Private::doVariableReplace(QString *str)
|
||||
{
|
||||
*str = expandVariableReferences(*str).join(Option::field_sep);
|
||||
*str = expandVariableReferences(*str).join(ProFileOption::field_sep);
|
||||
}
|
||||
|
||||
QStringList ProFileEvaluator::Private::expandVariableReferences(const QString &str)
|
||||
@@ -1556,7 +1557,7 @@ QStringList ProFileEvaluator::Private::expandVariableReferences(const QString &s
|
||||
current = str.left(start_var);
|
||||
if (!replacement.isEmpty()) {
|
||||
if (quote) {
|
||||
current += replacement.join(Option::field_sep);
|
||||
current += replacement.join(ProFileOption::field_sep);
|
||||
} else {
|
||||
current += replacement.takeFirst();
|
||||
if (!replacement.isEmpty()) {
|
||||
@@ -1722,7 +1723,7 @@ QStringList ProFileEvaluator::Private::evaluateExpandFunction(const QString &fun
|
||||
|
||||
QStringList args; //why don't the builtin functions just use args_list? --Sam
|
||||
foreach (const QStringList &arg, args_list)
|
||||
args += arg.join(Option::field_sep);
|
||||
args += arg.join(ProFileOption::field_sep);
|
||||
|
||||
enum ExpandFunc { E_MEMBER=1, E_FIRST, E_LAST, E_CAT, E_FROMFILE, E_EVAL, E_LIST,
|
||||
E_SPRINTF, E_JOIN, E_SPLIT, E_BASENAME, E_DIRNAME, E_SECTION,
|
||||
@@ -1834,7 +1835,7 @@ QStringList ProFileEvaluator::Private::evaluateExpandFunction(const QString &fun
|
||||
if (args.count() != 2) {
|
||||
logMessage(format("split(var, sep) requires one or two arguments"));
|
||||
} else {
|
||||
const QString &sep = (args.count() == 2) ? args[1] : Option::field_sep;
|
||||
const QString &sep = (args.count() == 2) ? args[1] : ProFileOption::field_sep;
|
||||
foreach (const QString &var, values(args.first()))
|
||||
foreach (const QString &splt, var.split(sep))
|
||||
ret.append(splt);
|
||||
@@ -2138,7 +2139,7 @@ ProItem::ProItemReturn ProFileEvaluator::Private::evaluateConditionalFunction(
|
||||
|
||||
QStringList args; //why don't the builtin functions just use args_list? --Sam
|
||||
foreach (const QStringList &arg, args_list)
|
||||
args += arg.join(Option::field_sep);
|
||||
args += arg.join(ProFileOption::field_sep);
|
||||
|
||||
enum TestFunc { T_REQUIRES=1, T_GREATERTHAN, T_LESSTHAN, T_EQUALS,
|
||||
T_EXISTS, T_EXPORT, T_CLEAR, T_UNSET, T_EVAL, T_CONFIG, T_SYSTEM,
|
||||
@@ -2497,7 +2498,7 @@ ProItem::ProItemReturn ProFileEvaluator::Private::evaluateConditionalFunction(
|
||||
logMessage(format("%1(variable, value) requires two arguments.").arg(function));
|
||||
return ProItem::ReturnFalse;
|
||||
}
|
||||
QString rhs(args[1]), lhs(values(args[0]).join(Option::field_sep));
|
||||
QString rhs(args[1]), lhs(values(args[0]).join(ProFileOption::field_sep));
|
||||
bool ok;
|
||||
int rhs_int = rhs.toInt(&ok);
|
||||
if (ok) { // do integer compare
|
||||
@@ -2517,7 +2518,7 @@ ProItem::ProItemReturn ProFileEvaluator::Private::evaluateConditionalFunction(
|
||||
logMessage(format("%1(variable, value) requires two arguments.").arg(function));
|
||||
return ProItem::ReturnFalse;
|
||||
}
|
||||
return returnBool(values(args[0]).join(Option::field_sep) == args[1]);
|
||||
return returnBool(values(args[0]).join(ProFileOption::field_sep) == args[1]);
|
||||
case T_CLEAR: {
|
||||
if (m_skipLevel && !m_cumulative)
|
||||
return ProItem::ReturnFalse;
|
||||
@@ -2923,7 +2924,7 @@ void ProFileEvaluator::Private::errorMessage(const QString &message) const
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
|
||||
ProFileEvaluator::ProFileEvaluator(ProFileEvaluator::Option *option)
|
||||
ProFileEvaluator::ProFileEvaluator(ProFileOption *option)
|
||||
: d(new Private(this, option))
|
||||
{
|
||||
}
|
||||
|
@@ -40,59 +40,18 @@
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class ProFileOption;
|
||||
|
||||
class ProFileEvaluator
|
||||
{
|
||||
class Private;
|
||||
public:
|
||||
|
||||
public:
|
||||
struct FunctionDefs {
|
||||
QHash<QString, ProBlock *> testFunctions;
|
||||
QHash<QString, ProBlock *> replaceFunctions;
|
||||
};
|
||||
|
||||
// This struct is from qmake, but we are not using everything.
|
||||
struct Option
|
||||
{
|
||||
Option();
|
||||
~Option();
|
||||
|
||||
//simply global convenience
|
||||
//QString libtool_ext;
|
||||
//QString pkgcfg_ext;
|
||||
//QString prf_ext;
|
||||
//QString prl_ext;
|
||||
//QString ui_ext;
|
||||
//QStringList h_ext;
|
||||
//QStringList cpp_ext;
|
||||
//QString h_moc_ext;
|
||||
//QString cpp_moc_ext;
|
||||
//QString obj_ext;
|
||||
//QString lex_ext;
|
||||
//QString yacc_ext;
|
||||
//QString h_moc_mod;
|
||||
//QString cpp_moc_mod;
|
||||
//QString lex_mod;
|
||||
//QString yacc_mod;
|
||||
QString dir_sep;
|
||||
QString dirlist_sep;
|
||||
QString qmakespec;
|
||||
QString cachefile;
|
||||
QHash<QString, QString> properties;
|
||||
|
||||
enum TARG_MODE { TARG_UNIX_MODE, TARG_WIN_MODE, TARG_MACX_MODE, TARG_MAC9_MODE, TARG_QNX6_MODE };
|
||||
TARG_MODE target_mode;
|
||||
//QString pro_ext;
|
||||
//QString res_ext;
|
||||
|
||||
private:
|
||||
friend class ProFileEvaluator;
|
||||
friend class ProFileEvaluator::Private;
|
||||
static QString field_sep; // Just a cache for quick construction
|
||||
QHash<QString, QStringList> base_valuemap; // Cached results of qmake.conf, .qmake.cache & default_pre.prf
|
||||
FunctionDefs base_functions;
|
||||
QStringList feature_roots;
|
||||
};
|
||||
|
||||
enum TemplateType {
|
||||
TT_Unknown = 0,
|
||||
TT_Application,
|
||||
@@ -101,7 +60,7 @@ public:
|
||||
TT_Subdirs
|
||||
};
|
||||
|
||||
ProFileEvaluator(Option *option);
|
||||
ProFileEvaluator(ProFileOption *option);
|
||||
virtual ~ProFileEvaluator();
|
||||
|
||||
ProFileEvaluator::TemplateType templateType();
|
||||
@@ -139,6 +98,51 @@ private:
|
||||
|
||||
// This doesn't help gcc 3.3 ...
|
||||
template<typename T> friend class QTypeInfo;
|
||||
|
||||
friend class ProFileOption;
|
||||
};
|
||||
|
||||
// This struct is from qmake, but we are not using everything.
|
||||
struct ProFileOption
|
||||
{
|
||||
ProFileOption();
|
||||
~ProFileOption();
|
||||
|
||||
//simply global convenience
|
||||
//QString libtool_ext;
|
||||
//QString pkgcfg_ext;
|
||||
//QString prf_ext;
|
||||
//QString prl_ext;
|
||||
//QString ui_ext;
|
||||
//QStringList h_ext;
|
||||
//QStringList cpp_ext;
|
||||
//QString h_moc_ext;
|
||||
//QString cpp_moc_ext;
|
||||
//QString obj_ext;
|
||||
//QString lex_ext;
|
||||
//QString yacc_ext;
|
||||
//QString h_moc_mod;
|
||||
//QString cpp_moc_mod;
|
||||
//QString lex_mod;
|
||||
//QString yacc_mod;
|
||||
QString dir_sep;
|
||||
QString dirlist_sep;
|
||||
QString qmakespec;
|
||||
QString cachefile;
|
||||
QHash<QString, QString> properties;
|
||||
|
||||
enum TARG_MODE { TARG_UNIX_MODE, TARG_WIN_MODE, TARG_MACX_MODE, TARG_MAC9_MODE, TARG_QNX6_MODE };
|
||||
TARG_MODE target_mode;
|
||||
//QString pro_ext;
|
||||
//QString res_ext;
|
||||
|
||||
private:
|
||||
friend class ProFileEvaluator;
|
||||
friend class ProFileEvaluator::Private;
|
||||
static QString field_sep; // Just a cache for quick construction
|
||||
QHash<QString, QStringList> base_valuemap; // Cached results of qmake.conf, .qmake.cache & default_pre.prf
|
||||
ProFileEvaluator::FunctionDefs base_functions;
|
||||
QStringList feature_roots;
|
||||
};
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
Reference in New Issue
Block a user