Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qmakeevaluator_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
3
4#ifndef QMAKEEVALUATOR_P_H
5#define QMAKEEVALUATOR_P_H
6
7#include "proitems.h"
8
9#define debugMsg if (!m_debugLevel) {} else debugMsgInternal
10#define traceMsg if (!m_debugLevel) {} else traceMsgInternal
11#ifdef PROEVALUATOR_DEBUG
12# define dbgBool(b) (b ? "true" : "false")
13# define dbgReturn(r)
14 (r == ReturnError ? "error" :
15 r == ReturnBreak ? "break" :
16 r == ReturnNext ? "next" :
17 r == ReturnReturn ? "return" :
18 "<invalid>")
19# define dbgKey(s) s.toString().toQStringView().toLocal8Bit().constData()
20# define dbgStr(s) qPrintable(formatValue(s, true))
21# define dbgStrList(s) qPrintable(formatValueList(s))
22# define dbgSepStrList(s) qPrintable(formatValueList(s, true))
23# define dbgStrListList(s) qPrintable(formatValueListList(s))
24# define dbgQStr(s) dbgStr(ProString(s))
25#else
26# define dbgBool(b) 0
27# define dbgReturn(r) 0
28# define dbgKey(s) 0
29# define dbgStr(s) 0
30# define dbgStrList(s) 0
31# define dbgSepStrList(s) 0
32# define dbgStrListList(s) 0
33# define dbgQStr(s) 0
34#endif
35
36QT_BEGIN_NAMESPACE
37
38namespace QMakeInternal {
39
41{
42 const char *name;
43 int func;
44 enum { VarArgs = 1000 };
46 const char *args;
47};
48
50{
51 QMakeBuiltin(const QMakeBuiltinInit &data);
52 QString usage;
54};
55
80
82
83}
84
86
87QT_END_NAMESPACE
88
89#endif // QMAKEEVALUATOR_P_H
void deref()
Definition proitems.h:420
const ushort * tokPtr() const
Definition proitems.h:416
bool isOk() const
Definition proitems.h:422
ProKey(const QString &str)
Definition proitems.cpp:102
PROITEM_EXPLICIT ProKey(const char *str)
Definition proitems.cpp:107
void removeAt(int idx)
Definition proitems.h:315
QString join(const ProString &sep) const
Definition proitems.cpp:329
void removeEach(const ProStringList &value)
Definition proitems.cpp:358
void removeDuplicates()
Definition proitems.cpp:375
QString & str()
Definition proitems.h:262
bool isEmpty() const
Definition proitems.h:96
ProString mid(int off, int len=-1) const
Definition proitems.cpp:268
int toInt(bool *ok=nullptr, int base=10) const
Definition proitems.h:130
int size() const
Definition proitems.h:98
bool operator==(const QString &other) const
Definition proitems.h:86
int sourceFile() const
Definition proitems.h:63
ProString left(int len) const
Definition proitems.h:102
PROITEM_EXPLICIT ProString(const char *str)
Definition proitems.cpp:64
ProString & setSource(int id)
Definition proitems.h:62
ProValueMap & top()
\inmodule QtCore
Definition qfile.h:93
\inmodule QtCore
Definition qhash.h:821
\inmodule QtCore\reentrant
QMakeEvaluator * evaluator
static ALWAYS_INLINE VisitReturn returnBool(bool b)
VisitReturn evaluateBuiltinConditional(const QMakeInternal::QMakeBuiltin &adef, const ProKey &function, const ProStringList &args)
QMakeParser * m_parser
QByteArray getCommandOutput(const QString &args, int *exitCode) const
QMakeGlobals * m_option
void populateDeps(const ProStringList &deps, const ProString &prefix, const ProStringList &suffixes, const ProString &priosfx, QHash< ProKey, QSet< ProKey > > &dependencies, ProValueMap &dependees, QMultiMap< int, ProString > &rootSet) const
int currentFileId() const
VisitReturn parseJsonInto(const QByteArray &json, const QString &into, ProValueMap *value)
bool getMemberArgs(const ProKey &name, int srclen, const ProStringList &args, int *start, int *end)
static void initFunctionStatics()
VisitReturn visitProBlock(ProFile *pro, const ushort *tokPtr)
QString currentDirectory() const
ALWAYS_INLINE const ProKey & map(const ProString &var)
QString filePathArg0(const ProStringList &args)
static QString quoteValue(const ProString &val)
ALWAYS_INLINE void traceMsgInternal(const char *,...) const
ProStringList & valuesRef(const ProKey &variableName)
VisitReturn writeFile(const QString &ctx, const QString &fn, QIODevice::OpenMode mode, QMakeVfs::VfsFlags flags, const QString &contents)
VisitReturn evaluateFeatureFile(const QString &fileName, bool silent=false)
QString filePathEnvArg0(const ProStringList &args)
ProStringList values(const ProKey &variableName) const
void evalError(const QString &msg) const
ProValueMapStack m_valuemapStack
QString expandEnvVars(const QString &str) const
void discardFileFromCache(int id)
@ VfsCreate
Definition qmakevfs.h:42
@ VfsAccessedOnly
Definition qmakevfs.h:45
\inmodule QtCore
#define fL1S(s)
Definition ioutils.cpp:21
QMakeStatics statics
QMap< ProKey, ProStringList > ProValueMap
Definition proitems.h:330
static void addJsonObject(const QJsonObject &object, const QString &keyPrefix, ProValueMap *map)
#define QT_POPEN
static void addJsonArray(const QJsonArray &array, const QString &keyPrefix, ProValueMap *map)
static ErrorPosition calculateErrorPosition(const QByteArray &json, int offset)
static bool isTrue(const ProString &str)
TestFunc
@ T_ISEMPTY
@ T_MKPATH
@ T_PARSE_JSON
@ T_EVAL
@ T_DEBUG
@ T_EQUALS
@ T_DISCARD_FROM
@ T_DEFINED
@ T_EXPORT
@ T_GREATERTHAN
@ T_LOAD
@ T_COUNT
@ T_TOUCH
@ T_MESSAGE
@ T_ERROR
@ T_INFILE
@ T_REQUIRES
@ T_VERSION_AT_MOST
@ T_EXISTS
@ T_LESSTHAN
@ T_CLEAR
@ T_VERSION_AT_LEAST
@ T_CONTAINS
@ T_RELOAD_PROPERTIES
@ T_WRITE_FILE
@ T_CACHE
@ T_INCLUDE
@ T_UNSET
@ T_CONFIG
@ T_LOG
@ T_IF
@ T_SYSTEM
@ T_INVALID
@ T_WARNING
static void addJsonValue(const QJsonValue &value, const QString &keyPrefix, ProValueMap *map)
static void insertJsonKeyValue(const QString &key, const QStringList &values, ProValueMap *map)
#define QT_PCLOSE
#define dbgKey(s)
#define traceMsg
Q_DECLARE_TYPEINFO(QMakeInternal::QMakeBuiltin, Q_RELOCATABLE_TYPE)
#define dbgSepStrList(s)
#define qPrintable(string)
Definition qstring.h:1552
#define QT_POPEN_READ
Definition main.cpp:41
\inmodule QtCore\reentrant
QMakeBuiltin(const QMakeBuiltinInit &data)
QHash< ProKey, ProKey > varMap
QHash< ProKey, QMakeBuiltin > functions
QHash< ProKey, QMakeBuiltin > expands