7#include <QtCore/qstring.h>
8#include <QtCore/qstringlist.h>
17 bool hasError()
const {
return !errorString.isEmpty(); }
int main(int argc, char *argv[])
[2]
void message(int type, const QString &msg, const QString &fileName, int lineNo) override
void fileMessage(int type, const QString &msg) override
void doneWithEval(ProFile *) override
void aboutToEval(ProFile *, ProFile *, EvalFileType) override
void discardFile(const QString &fileName, QMakeVfs *vfs)
void discardFiles(const QString &prefix, QMakeVfs *vfs)
ProFileEvaluator::TemplateType templateType() const
ProFileEvaluator(ProFileGlobals *option, QMakeParser *parser, QMakeVfs *vfs, QMakeHandler *handler)
void setExtraConfigs(const QStringList &extraConfigs)
void setExtraVars(const QHash< QString, QStringList > &extraVars)
QStringList values(const QString &variableName, const ProFile *pro) const
QString value(const QString &variableName) const
bool contains(const QString &variableName) const
QString resolvedMkSpec() const
bool accept(ProFile *pro, QMakeEvaluator::LoadFlags flags=QMakeEvaluator::LoadAll)
QStringList absoluteFileValues(const QString &variable, const QString &baseDirectory, const QStringList &searchDirs, const ProFile *pro) const
void setOutputDir(const QString &dir)
QStringList absolutePathValues(const QString &variable, const QString &baseDirectory) const
QStringList values(const QString &variableName) const
QString propertyValue(const QString &val) const
bool loadNamedSpec(const QString &specDir, bool hostSpec)
const ushort * tokPtrEnd() const
ProFile(int id, const QString &fileName)
const ushort * tokPtr() const
QString directoryName() const
ProString getStr(const ushort *&tPtr)
const QString & items() const
ProKey getHashStr(const ushort *&tPtr)
void setHostBuild(bool host_build)
const ushort * tokPtr() const
ProFunctionDef(ProFunctionDef &&other) noexcept
ProFunctionDef(ProFile *pro, int offset)
void swap(ProFunctionDef &other) noexcept
ProFunctionDef & operator=(ProFunctionDef &&other) noexcept
ProFunctionDef(const ProFunctionDef &o)
ProFunctionDef & operator=(const ProFunctionDef &o)
ProItemRefCount(int cnt=0)
ProItemRefCount & operator=(int value)
void setValue(const QString &str)
ProKey(const QString &str, int off, int len, uint hash)
ALWAYS_INLINE const ProString & toString() const
ProKey(const QStringBuilder< A, B > &str)
ProKey(const QString &str)
ALWAYS_INLINE ProString & toString()
PROITEM_EXPLICIT ProKey(const char *str)
ProKey(const QString &str, int off, int len)
void removeAll(const ProString &str)
bool contains(const QString &str, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
QString join(QChar sep) const
QString join(const ProString &sep) const
bool contains(const char *str, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
void removeAll(const char *str)
void insertUnique(const ProStringList &value)
QString join(const QStringBuilder< A, B > &str)
QString join(const QString &sep) const
bool contains(QStringView str, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
void removeEach(const ProStringList &value)
ProStringList(const ProString &str)
ProStringList(const QStringList &list)
bool contains(const ProString &str, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
QStringList toQStringList() const
ProStringRoUser(const ProString &ps, QString &rs)
ProStringRoUser(QString &rs)
QString & set(const ProString &ps)
ProStringRwUser(QString &rs)
ProString extract(const QString &s) const
QString & set(const ProString &ps)
ProStringRwUser(const ProString &ps, QString &rs)
ProString extract(const QString &s, const ProStringRwUser &other) const
ProString & operator+=(const QLatin1String other)
ProString & setSource(const ProString &other)
QString & toQString(QString &tmp) const
ProString & operator=(const ProString &)=default
bool startsWith(const ProString &sub, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
ALWAYS_INLINE const ProKey & toKey() const
bool startsWith(QChar c, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
friend size_t qHash(const ProString &str)
int indexOf(QChar c, int from=0, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
bool contains(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
ProString & append(QChar other)
ProString & operator=(const QStringBuilder< A, B > &str)
QByteArray toLatin1() const
bool operator<(const ProString &other) const
ProString mid(int off, int len=-1) const
bool operator==(const ProString &other) const
int lastIndexOf(QChar c, int from=-1, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
QString toQString() const
ProString(const QString &str)
bool operator!=(const QString &other) const
bool endsWith(const QStringBuilder< A, B > &str)
ProString & append(const QLatin1String other)
ALWAYS_INLINE QStringView toQStringView() const
int toInt(bool *ok=nullptr, int base=10) const
int indexOf(const QString &s, int from=0, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
void setValue(const QString &str)
bool operator==(const char *other) const
int compare(const QString &sub, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
ProString(const QString &str, int offset, int length)
ProString & operator+=(QChar other)
ProString & operator+=(const ProString &other)
int compare(const char *sub, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
bool operator!=(QLatin1String other) const
int compare(const ProString &sub, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
ProString right(int len) const
static size_t hash(const QChar *p, int n)
ProString & prepend(const ProString &other)
ALWAYS_INLINE ProKey & toKey()
int indexOf(const char *s, int from=0, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
qlonglong toLongLong(bool *ok=nullptr, int base=10) const
ProString & append(const char *other)
PROITEM_EXPLICIT ProString(QStringView str)
int lastIndexOf(const QString &s, int from=-1, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
bool endsWith(const QString &sub, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
bool operator!=(const char *other) const
bool contains(QChar c, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
const QChar * constData() const
bool operator==(const QString &other) const
ProString(const QStringBuilder< A, B > &str)
bool startsWith(const QStringBuilder< A, B > &str)
bool startsWith(const char *sub, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
int lastIndexOf(const char *s, int from=-1, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
friend QString operator+(const ProString &one, const ProString &two)
ProString & operator+=(const QString &other)
ProString trimmed() const
ProString & operator+=(const char *other)
bool endsWith(const char *sub, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
ProString left(int len) const
ProString & append(const ProString &other, bool *pending=nullptr)
bool endsWith(QChar c, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
ProString & append(const QString &other)
ProString & append(const QStringBuilder< A, B > &other)
bool contains(const char *s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
bool operator!=(const ProString &other) const
ProString & operator+=(const QStringBuilder< A, B > &other)
PROITEM_EXPLICIT ProString(const char *str)
bool operator==(QStringView other) const
bool endsWith(const ProString &sub, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
ProString & setSource(int id)
ProString & append(const ProStringList &other, bool *pending=nullptr, bool skipEmpty1st=false)
bool startsWith(const QString &sub, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
short toShort(bool *ok=nullptr, int base=10) const
ProString(const ProString &other)
const ProValueMap & top() const
void push(const ProValueMap &t)
QMakeEvaluator * evaluator
QMakeBaseKey(const QString &_root, const QString &_stash, bool _hostBuild)
QMakeCmdLineParserState(const QString &_pwd)
QStringList m_mkspecPaths
QString resolvePath(const QString &fileName) const
ProFunctionDefs m_functionDefs
QStringList m_qmakefeatures
VisitReturn evaluateFileInto(const QString &fileName, ProValueMap *values, LoadFlags flags)
static ALWAYS_INLINE VisitReturn returnBool(bool b)
QStack< ProFile * > m_profileStack
VisitReturn evaluateBuiltinConditional(const QMakeInternal::QMakeBuiltin &adef, const ProKey &function, const ProStringList &args)
QByteArray getCommandOutput(const QString &args, int *exitCode) const
QExplicitlySharedDataPointer< QMakeFeatureRoots > m_featureRoots
ProStringList split_value_list(QStringView vals, int source=0)
VisitReturn evaluateBuiltinExpand(const QMakeInternal::QMakeBuiltin &adef, const ProKey &function, const ProStringList &args, ProStringList &ret)
VisitReturn prepareFunctionArgs(const ushort *&tokPtr, QList< ProStringList > *ret)
VisitReturn evaluateConfigFeatures()
VisitReturn visitProVariable(ushort tok, const ProStringList &curr, const ushort *&tokPtr)
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 visitProBlock(const ushort *tokPtr)
VisitReturn parseJsonInto(const QByteArray &json, const QString &into, ProValueMap *value)
bool getMemberArgs(const ProKey &name, int srclen, const ProStringList &args, int *start, int *end)
VisitReturn evaluateFunction(const ProFunctionDef &func, const QList< ProStringList > &argumentsList, ProStringList *ret)
QMakeEvaluator(QMakeGlobals *option, QMakeParser *parser, QMakeVfs *vfs, QMakeHandler *handler)
static void initFunctionStatics()
VisitReturn visitProBlock(ProFile *pro, const ushort *tokPtr)
bool prepareProject(const QString &inDir)
VisitReturn evaluateBoolFunction(const ProFunctionDef &func, const QList< ProStringList > &argumentsList, const ProString &function)
QStack< Location > m_locationStack
QString currentDirectory() const
VisitReturn evaluateFile(const QString &fileName, QMakeHandler::EvalFileType type, LoadFlags flags)
VisitReturn expandVariableReferences(const ushort *&tokPtr, int sizeHint, ProStringList *ret, bool joined)
void languageWarning(const QString &msg) const
ALWAYS_INLINE const ProKey & map(const ProString &var)
ProString first(const ProKey &variableName) const
static ALWAYS_INLINE void skipStr(const ushort *&tokPtr)
QString filePathArg0(const ProStringList &args)
ProString propertyValue(const ProKey &val) const
ProStringList m_returnValue
static QString quoteValue(const ProString &val)
static ALWAYS_INLINE void skipHashStr(const ushort *&tokPtr)
ProStringList m_extraConfigs
VisitReturn evaluateConditional(QStringView cond, const QString &where, int line=-1)
void updateFeaturePaths()
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)
void setExtraConfigs(const ProStringList &extraConfigs)
VisitReturn evaluateFileChecked(const QString &fileName, QMakeHandler::EvalFileType type, LoadFlags flags)
QString filePathEnvArg0(const ProStringList &args)
VisitReturn visitProFile(ProFile *pro, QMakeHandler::EvalFileType type, LoadFlags flags)
void message(int type, const QString &msg) const
ALWAYS_INLINE void debugMsgInternal(int, const char *,...) const
const ProKey & map(const ProKey &var)
ProValueMap * findValues(const ProKey &variableName, ProValueMap::Iterator *it)
void initFrom(const QMakeEvaluator *other)
ProStringList values(const ProKey &variableName) const
static ALWAYS_INLINE uint getBlockLen(const ushort *&tokPtr)
void setOutputDir(const QString &outputDir)
void evaluateCommand(const QString &cmds, const QString &where)
ProFile * currentProFile() const
VisitReturn evaluateExpandFunction(const ProKey &function, const ushort *&tokPtr, ProStringList *ret)
void setExtraVars(const ProValueMap &extraVars)
void skipExpression(const ushort *&tokPtr)
void visitProFunctionDef(ushort tok, const ProKey &name, const ushort *tokPtr)
VisitReturn evaluateExpression(const ushort *&tokPtr, ProStringList *ret, bool joined)
void evalError(const QString &msg) const
ProValueMapStack m_valuemapStack
void deprecationWarning(const QString &msg) const
VisitReturn visitProLoop(const ProKey &variable, const ushort *exprPtr, const ushort *tokPtr)
QMakeEvaluator * m_caller
bool isActiveConfig(QStringView config, bool regex=false)
VisitReturn evaluateConditionalFunction(const ProKey &function, const ushort *&tokPtr)
QString currentFileName() const
QMakeFeatureRoots(const QStringList &_paths)
QString user_template_prefix
QStringList splitPathList(const QString &value) const
void setCommandLineArguments(const QString &pwd, const QStringList &args)
void setProperties(const QHash< ProKey, ProString > &props)
void setDirectories(const QString &input_dir, const QString &output_dir)
QString expandEnvVars(const QString &str) const
QStringList qmake_extra_args
QString qmake_abslocation
void commitCommandLineArguments(QMakeCmdLineParserState &state)
ArgumentReturn addCommandLineArguments(QMakeCmdLineParserState &state, QStringList &args, int *pos)
QString shadowedPath(const QString &fileName) const
static void parseProperties(const QByteArray &data, QHash< ProKey, ProString > &props)
ProString propertyValue(const ProKey &name) const
virtual void fileMessage(int type, const QString &msg)=0
virtual void aboutToEval(ProFile *parent, ProFile *proFile, EvalFileType type)=0
virtual void doneWithEval(ProFile *parent)=0
This class provides replacement functionality for QFileInfo, QFile & QDir, as these are abysmally slo...
static QString shellQuote(const QString &arg)
static bool exists(const QString &fileName)
static QStringView fileName(const QString &fileName)
static FileType fileType(const QString &fileName)
static bool isRelativePath(const QString &fileName)
static QString binaryAbsLocation(const QString &argv0)
static bool isAbsolutePath(const QString &fileName)
static QStringView pathName(const QString &fileName)
static QString resolvePath(const QString &baseDir, const QString &fileName)
static QString shellQuoteWin(const QString &arg)
static QString shellQuoteUnix(const QString &arg)
virtual void message(int type, const QString &msg, const QString &fileName=QString(), int lineNo=0)=0
void discardFileFromCache(int id)
ProFile * parsedProBlock(QStringView contents, int id, const QString &name, int line=0, SubGrammar grammar=FullGrammar)
ProFile * parsedProFile(const QString &fileName, ParseFlags flags=ParseDefault)
bool writeFile(int id, QIODevice::OpenMode mode, VfsFlags flags, const QString &contents, QString *errStr)
QString fileNameForId(int id)
bool exists(const QString &fn, QMakeVfs::VfsFlags flags)
void invalidateContents()
int idForFileName(const QString &fn, VfsFlags flags)
ReadResult readFile(int id, QString *contents, QString *errStr)
Combined button and popup list for selecting options.
const QString & asString(const QString &s)
QStringList extractProFiles(QStringList *files)
Q_DECLARE_TYPEINFO(ProString, Q_RELOCATABLE_TYPE)
QString & operator+=(QString &that, const ProString &other)
QDebug operator<<(QDebug debug, const ProString &str)
Q_DECLARE_TYPEINFO(ProStringList, Q_RELOCATABLE_TYPE)
Q_DECLARE_TYPEINFO(ProFunctionDef, Q_RELOCATABLE_TYPE)
QMap< ProKey, ProStringList > ProValueMap
Q_DECLARE_TYPEINFO(ProKey, Q_RELOCATABLE_TYPE)
ProStringList operator+(const ProStringList &one, const ProStringList &two)
QPair< QString, QString > QMakeFeatureKey
Q_DECLARE_TYPEINFO(QMakeEvaluator::Location, Q_PRIMITIVE_TYPE)
QHash< QMakeFeatureKey, QString > QMakeFeatureHash
bool operator==(const QMakeBaseKey &one, const QMakeBaseKey &two)
size_t qHash(const QMakeBaseKey &key)
Q_DECLARE_TYPEINFO(QMakeParser::BlockScope, Q_RELOCATABLE_TYPE)
Q_DECLARE_TYPEINFO(QMakeParser::Context, Q_PRIMITIVE_TYPE)
ReadQrcResult readQrcFile(const QString &resourceFile, const QString &content)
bool isSupportedExtension(const QString &ext)
#define qPrintable(string)
static void printOut(const QString &out)
QStringList getExcludes(const ProFileEvaluator &visitor, const QString &projectDirPath)
static QStringList getSources(const ProFileEvaluator &visitor, const QString &projectDir, QMakeVfs *vfs)
static void excludeProjects(const ProFileEvaluator &visitor, QStringList *subProjects)
void setValue(QJsonObject &obj, const char *key, T value)
static void print(const QString &fileName, int lineNo, const QString &msg)
static QJsonValue toJsonValue(const QString &s)
static QJsonObject processProject(const QString &proFile, const QStringList &translationsVariables, ProFileGlobals *option, QMakeVfs *vfs, QMakeParser *parser, ProFileEvaluator &visitor)
static EvalHandler evalHandler
static QJsonValue toJsonValue(const QJsonValue &v)
static QStringList getSources(const char *var, const char *vvar, const QStringList &baseVPaths, const QString &projectDir, const ProFileEvaluator &visitor)
static QJsonArray processProjects(bool topLevel, const QStringList &proFiles, const QStringList &translationsVariables, const QHash< QString, QString > &outDirMap, ProFileGlobals *option, QMakeVfs *vfs, QMakeParser *parser, bool *fail)
static QStringList getResources(const QString &resourceFile, QMakeVfs *vfs)
static void printErr(const QString &out)
QHash< ProKey, ProFunctionDef > replaceFunctions
QHash< ProKey, ProFunctionDef > testFunctions
static void appendTo(const ProString &a, QChar *&out)
static int size(const ProString &a)
Location(ProFile *_pro, ushort _line)