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
proitems.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 PROITEMS_H
5#define PROITEMS_H
6
7#include "qmake_global.h"
8
9#include <qdebug.h>
10#include <qhash.h>
11#include <qlist.h>
12#include <qmap.h>
13#include <qstring.h>
14
16
17class QTextStream;
18
19#ifdef PROPARSER_THREAD_SAFE
20typedef QAtomicInt ProItemRefCount;
21#else
23public:
24 ProItemRefCount(int cnt = 0) : m_cnt(cnt) {}
25 bool ref() { return ++m_cnt != 0; }
26 bool deref() { return --m_cnt != 0; }
27 ProItemRefCount &operator=(int value) { m_cnt = value; return *this; }
28private:
29 int m_cnt;
30};
31#endif
32
33#ifndef QT_BUILD_QMAKE
34# define PROITEM_EXPLICIT explicit
35#else
36# define PROITEM_EXPLICIT
37#endif
38
39class ProKey;
40class ProStringList;
41class ProFile;
42
43class ProString {
44public:
45 ProString();
46 ProString(const ProString &other);
47 ProString &operator=(const ProString &) = default;
48 template<typename A, typename B>
49 ProString &operator=(const QStringBuilder<A, B> &str)
50 { return *this = QString(str); }
51 ProString(const QString &str);
52 PROITEM_EXPLICIT ProString(QStringView str);
53 PROITEM_EXPLICIT ProString(const char *str);
54 template<typename A, typename B>
55 ProString(const QStringBuilder<A, B> &str)
56 : ProString(QString(str))
57 {}
58 ProString(const QString &str, int offset, int length);
59 void setValue(const QString &str);
60 void clear() { m_string.clear(); m_length = 0; }
61 ProString &setSource(const ProString &other) { m_file = other.m_file; return *this; }
62 ProString &setSource(int id) { m_file = id; return *this; }
63 int sourceFile() const { return m_file; }
64
65 ProString &prepend(const ProString &other);
66 ProString &append(const ProString &other, bool *pending = nullptr);
67 ProString &append(const QString &other) { return append(ProString(other)); }
68 template<typename A, typename B>
69 ProString &append(const QStringBuilder<A, B> &other) { return append(QString(other)); }
70 ProString &append(const QLatin1String other);
71 ProString &append(const char *other) { return append(QLatin1String(other)); }
72 ProString &append(QChar other);
73 ProString &append(const ProStringList &other, bool *pending = nullptr, bool skipEmpty1st = false);
74 ProString &operator+=(const ProString &other) { return append(other); }
75 ProString &operator+=(const QString &other) { return append(other); }
76 template<typename A, typename B>
77 ProString &operator+=(const QStringBuilder<A, B> &other) { return append(QString(other)); }
78 ProString &operator+=(const QLatin1String other) { return append(other); }
79 ProString &operator+=(const char *other) { return append(other); }
80 ProString &operator+=(QChar other) { return append(other); }
81
82 void chop(int n) { Q_ASSERT(n <= m_length); m_length -= n; }
83 void chopFront(int n) { Q_ASSERT(n <= m_length); m_offset += n; m_length -= n; }
84
85 bool operator==(const ProString &other) const { return toQStringView() == other.toQStringView(); }
86 bool operator==(const QString &other) const { return toQStringView() == other; }
87 bool operator==(QStringView other) const { return toQStringView() == other; }
88 bool operator==(QLatin1String other) const { return toQStringView() == other; }
89 bool operator==(const char *other) const { return toQStringView() == QLatin1String(other); }
90 bool operator!=(const ProString &other) const { return !(*this == other); }
91 bool operator!=(const QString &other) const { return !(*this == other); }
92 bool operator!=(QLatin1String other) const { return !(*this == other); }
93 bool operator!=(const char *other) const { return !(*this == other); }
94 bool operator<(const ProString &other) const { return toQStringView() < other.toQStringView(); }
95 bool isNull() const { return m_string.isNull(); }
96 bool isEmpty() const { return !m_length; }
97 int length() const { return m_length; }
98 int size() const { return m_length; }
99 QChar at(int i) const { Q_ASSERT((uint)i < (uint)m_length); return constData()[i]; }
100 const QChar *constData() const { return m_string.constData() + m_offset; }
101 ProString mid(int off, int len = -1) const;
102 ProString left(int len) const { return mid(0, len); }
103 ProString right(int len) const { return mid(qMax(0, size() - len)); }
104 ProString trimmed() const;
105 int compare(const ProString &sub, Qt::CaseSensitivity cs = Qt::CaseSensitive) const { return toQStringView().compare(sub.toQStringView(), cs); }
106 int compare(const QString &sub, Qt::CaseSensitivity cs = Qt::CaseSensitive) const { return toQStringView().compare(sub, cs); }
107 int compare(const char *sub, Qt::CaseSensitivity cs = Qt::CaseSensitive) const { return toQStringView().compare(QLatin1String(sub), cs); }
108 bool startsWith(const ProString &sub, Qt::CaseSensitivity cs = Qt::CaseSensitive) const { return toQStringView().startsWith(sub.toQStringView(), cs); }
109 bool startsWith(const QString &sub, Qt::CaseSensitivity cs = Qt::CaseSensitive) const { return toQStringView().startsWith(sub, cs); }
110 bool startsWith(const char *sub, Qt::CaseSensitivity cs = Qt::CaseSensitive) const { return toQStringView().startsWith(QLatin1String(sub), cs); }
111 bool startsWith(QChar c, Qt::CaseSensitivity cs = Qt::CaseSensitive) const { return toQStringView().startsWith(c, cs); }
112 template<typename A, typename B>
113 bool startsWith(const QStringBuilder<A, B> &str) { return startsWith(QString(str)); }
114 bool endsWith(const ProString &sub, Qt::CaseSensitivity cs = Qt::CaseSensitive) const { return toQStringView().endsWith(sub.toQStringView(), cs); }
115 bool endsWith(const QString &sub, Qt::CaseSensitivity cs = Qt::CaseSensitive) const { return toQStringView().endsWith(sub, cs); }
116 bool endsWith(const char *sub, Qt::CaseSensitivity cs = Qt::CaseSensitive) const { return toQStringView().endsWith(QLatin1String(sub), cs); }
117 template<typename A, typename B>
118 bool endsWith(const QStringBuilder<A, B> &str) { return endsWith(QString(str)); }
119 bool endsWith(QChar c, Qt::CaseSensitivity cs = Qt::CaseSensitive) const { return toQStringView().endsWith(c, cs); }
120 int indexOf(const QString &s, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const { return toQStringView().indexOf(s, from, cs); }
121 int indexOf(const char *s, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const { return toQStringView().indexOf(QLatin1String(s), from, cs); }
122 int indexOf(QChar c, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const { return toQStringView().indexOf(c, from, cs); }
123 int lastIndexOf(const QString &s, int from = -1, Qt::CaseSensitivity cs = Qt::CaseSensitive) const { return toQStringView().lastIndexOf(s, from, cs); }
124 int lastIndexOf(const char *s, int from = -1, Qt::CaseSensitivity cs = Qt::CaseSensitive) const { return toQStringView().lastIndexOf(QLatin1String(s), from, cs); }
125 int lastIndexOf(QChar c, int from = -1, Qt::CaseSensitivity cs = Qt::CaseSensitive) const { return toQStringView().lastIndexOf(c, from, cs); }
126 bool contains(const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const { return indexOf(s, 0, cs) >= 0; }
127 bool contains(const char *s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const { return indexOf(QLatin1String(s), 0, cs) >= 0; }
128 bool contains(QChar c, Qt::CaseSensitivity cs = Qt::CaseSensitive) const { return indexOf(c, 0, cs) >= 0; }
129 qlonglong toLongLong(bool *ok = nullptr, int base = 10) const { return toQStringView().toLongLong(ok, base); }
130 int toInt(bool *ok = nullptr, int base = 10) const { return toQStringView().toInt(ok, base); }
131 short toShort(bool *ok = nullptr, int base = 10) const { return toQStringView().toShort(ok, base); }
132
133 size_t hash() const { return m_hash; }
134 static size_t hash(const QChar *p, int n);
135
136 ALWAYS_INLINE QStringView toQStringView() const { return QStringView(m_string).mid(m_offset, m_length); }
137
138 ALWAYS_INLINE ProKey &toKey() { return *(ProKey *)this; }
139 ALWAYS_INLINE const ProKey &toKey() const { return *(const ProKey *)this; }
140
141 QString toQString() const;
142 QString &toQString(QString &tmp) const;
143
144 QByteArray toLatin1() const { return toQStringView().toLatin1(); }
145
146private:
147 ProString(const ProKey &other);
148 ProString &operator=(const ProKey &other);
149
150 enum OmitPreHashing { NoHash };
151 ProString(const ProString &other, OmitPreHashing);
152
153 enum DoPreHashing { DoHash };
154 ALWAYS_INLINE ProString(const QString &str, DoPreHashing);
155 ALWAYS_INLINE ProString(const char *str, DoPreHashing);
156 ALWAYS_INLINE ProString(const QString &str, int offset, int length, DoPreHashing);
157 ALWAYS_INLINE ProString(const QString &str, int offset, int length, uint hash);
158
159 QString m_string;
160 int m_offset, m_length;
161 int m_file;
162 mutable size_t m_hash;
163 size_t updatedHash() const;
164 friend size_t qHash(const ProString &str, size_t seed);
165 friend QString operator+(const ProString &one, const ProString &two);
166 friend class ProKey;
167};
169
170
171class ProKey : public ProString {
172public:
174 explicit ProKey(const QString &str);
175 template<typename A, typename B>
176 ProKey(const QStringBuilder<A, B> &str)
177 : ProString(str)
178 {}
179 PROITEM_EXPLICIT ProKey(const char *str);
180 ProKey(const QString &str, int off, int len);
181 ProKey(const QString &str, int off, int len, uint hash);
182 void setValue(const QString &str);
183
184#ifdef Q_CC_MSVC
185 // Workaround strange MSVC behaviour when exporting classes with ProKey members.
188 {
189 toString() = other.toString();
190 return *this;
191 }
192#endif
193
195 ALWAYS_INLINE const ProString &toString() const { return *(const ProString *)this; }
196
197private:
198 ProKey(const ProString &other);
199};
201
202template <> struct QConcatenable<ProString>
203{
205 typedef QString ConvertTo;
206 enum { ExactSize = true };
207 static int size(const ProString &a) { return a.length(); }
208 static inline void appendTo(const ProString &a, QChar *&out)
209 {
210 const auto n = a.size();
211 if (!n)
212 return;
213 memcpy(out, a.toQStringView().data(), sizeof(QChar) * n);
214 out += n;
215 }
216};
217
218template <> struct QConcatenable<ProKey>
219{
220 typedef ProKey type;
221 typedef QString ConvertTo;
222 enum { ExactSize = true };
223 static int size(const ProKey &a) { return a.length(); }
224 static inline void appendTo(const ProKey &a, QChar *&out)
225 {
226 const auto n = a.size();
227 if (!n)
228 return;
229 memcpy(out, a.toQStringView().data(), sizeof(QChar) * n);
230 out += n;
231 }
232};
233
234size_t qHash(const ProString &str, size_t seed = 0);
235
236inline QString &operator+=(QString &that, const ProString &other)
237 { return that += other.toQStringView(); }
238
239QTextStream &operator<<(QTextStream &t, const ProString &str);
240template<typename A, typename B>
241QTextStream &operator<<(QTextStream &t, const QStringBuilder<A, B> &str) { return t << QString(str); }
242
243// This class manages read-only access to a ProString via a raw data QString
244// temporary, ensuring that the latter is accessed exclusively.
246{
247public:
248 ProStringRoUser(QString &rs)
249 {
250 m_rs = &rs;
251 }
252 ProStringRoUser(const ProString &ps, QString &rs)
254 {
255 ps.toQString(rs);
256 }
257 // No destructor, as a RAII pattern cannot be used: references to the
258 // temporary string can legitimately outlive instances of this class
259 // (if they are held by Qt, e.g. in QRegExp).
260 QString &set(const ProString &ps) { return ps.toQString(*m_rs); }
261 QString &str() { return *m_rs; }
262
263protected:
264 QString *m_rs;
265};
266
267// This class manages read-write access to a ProString via a raw data QString
268// temporary, ensuring that the latter is accessed exclusively, and that raw
269// data does not leak outside its source's refcounting.
271{
272public:
273 ProStringRwUser(QString &rs)
274 : ProStringRoUser(rs), m_ps(nullptr) {}
275 ProStringRwUser(const ProString &ps, QString &rs)
276 : ProStringRoUser(ps, rs), m_ps(&ps) {}
277 QString &set(const ProString &ps) { m_ps = &ps; return ProStringRoUser::set(ps); }
278 ProString extract(const QString &s) const
279 { return s.isSharedWith(*m_rs) ? *m_ps : ProString(s).setSource(*m_ps); }
280 ProString extract(const QString &s, const ProStringRwUser &other) const
281 {
282 if (other.m_ps && s.isSharedWith(*other.m_rs))
283 return *other.m_ps;
284 return extract(s);
285 }
286
287private:
288 const ProString *m_ps;
289};
290
292public:
294 ProStringList(const ProString &str) { *this << str; }
295 explicit ProStringList(const QStringList &list);
297
298 ProStringList &operator<<(const ProString &str)
299 { QList<ProString>::operator<<(str); return *this; }
300
301 int length() const { return size(); }
302
303 QString join(const ProString &sep) const;
304 QString join(const QString &sep) const;
305 QString join(QChar sep) const;
306 template<typename A, typename B>
307 QString join(const QStringBuilder<A, B> &str) { return join(QString(str)); }
308
309 void insertUnique(const ProStringList &value);
310
311 void removeAll(const ProString &str);
312 void removeAll(const char *str);
313 void removeEach(const ProStringList &value);
314 void removeAt(int idx) { remove(idx); }
315 void removeEmpty();
316 void removeDuplicates();
317
318 bool contains(const ProString &str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
319 bool contains(QStringView str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
320 bool contains(const QString &str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
321 { return contains(ProString(str), cs); }
322 bool contains(const char *str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
323};
325
326inline ProStringList operator+(const ProStringList &one, const ProStringList &two)
327 { ProStringList ret = one; ret += two; return ret; }
328
330
331// These token definitions affect both ProFileEvaluator and ProWriter
333 TokTerminator = 0, // end of stream (possibly not included in length; must be zero)
334 TokLine, // line marker:
335 // - line (1)
336 TokAssign, // variable =
337 TokAppend, // variable +=
338 TokAppendUnique, // variable *=
339 TokRemove, // variable -=
340 TokReplace, // variable ~=
341 // previous literal/expansion is a variable manipulation
342 // - lower bound for expected output length (1)
343 // - value expression + TokValueTerminator
344 TokValueTerminator, // assignment value terminator
345 TokLiteral, // literal string (fully dequoted)
346 // - length (1)
347 // - string data (length; unterminated)
348 TokHashLiteral, // literal string with hash (fully dequoted)
349 // - hash (2)
350 // - length (1)
351 // - string data (length; unterminated)
352 TokVariable, // qmake variable expansion
353 // - hash (2)
354 // - name length (1)
355 // - name (name length; unterminated)
356 TokProperty, // qmake property expansion
357 // - hash (2)
358 // - name length (1)
359 // - name (name length; unterminated)
360 TokEnvVar, // environment variable expansion
361 // - name length (1)
362 // - name (name length; unterminated)
363 TokFuncName, // replace function expansion
364 // - hash (2)
365 // - name length (1)
366 // - name (name length; unterminated)
367 // - ((nested expansion + TokArgSeparator)* + nested expansion)?
368 // - TokFuncTerminator
369 TokArgSeparator, // function argument separator
370 TokFuncTerminator, // function argument list terminator
371 TokCondition, // previous literal/expansion is a conditional
372 TokTestCall, // previous literal/expansion is a test function call
373 // - ((nested expansion + TokArgSeparator)* + nested expansion)?
374 // - TokFuncTerminator
375 TokReturn, // previous literal/expansion is a return value
376 TokBreak, // break loop
377 TokNext, // shortcut to next loop iteration
378 TokNot, // '!' operator
379 TokAnd, // ':' operator
380 TokOr, // '|' operator
381 TokBranch, // branch point:
382 // - then block length (2)
383 // - then block + TokTerminator (then block length)
384 // - else block length (2)
385 // - else block + TokTerminator (else block length)
386 TokForLoop, // for loop:
387 // - variable name: hash (2), length (1), chars (length)
388 // - expression: length (2), bytes + TokValueTerminator (length)
389 // - body length (2)
390 // - body + TokTerminator (body length)
391 TokTestDef, // test function definition:
392 TokReplaceDef, // replace function definition:
393 // - function name: hash (2), length (1), chars (length)
394 // - body length (2)
395 // - body + TokTerminator (body length)
396 TokBypassNesting, // escape from function local variable scopes:
397 // - block length (2)
398 // - block + TokTerminator (block length)
399 TokMask = 0xff,
400 TokQuoted = 0x100, // The expression is quoted => join expanded stringlist
401 TokNewStr = 0x200 // Next stringlist element
402};
403
405{
406public:
407 ProFile(int id, const QString &fileName);
408 ~ProFile();
409
410 int id() const { return m_id; }
411 QString fileName() const { return m_fileName; }
412 QString directoryName() const { return m_directoryName; }
413 const QString &items() const { return m_proitems; }
414 QString *itemsRef() { return &m_proitems; }
415 const ushort *tokPtr() const { return (const ushort *)m_proitems.constData(); }
416 const ushort *tokPtrEnd() const { return (const ushort *)m_proitems.constData() + m_proitems.size(); }
417
418 void ref() { m_refCount.ref(); }
419 void deref() { if (!m_refCount.deref()) delete this; }
420
421 bool isOk() const { return m_ok; }
422 void setOk(bool ok) { m_ok = ok; }
423
424 bool isHostBuild() const { return m_hostBuild; }
425 void setHostBuild(bool host_build) { m_hostBuild = host_build; }
426
427 ProString getStr(const ushort *&tPtr);
428 ProKey getHashStr(const ushort *&tPtr);
429
430private:
431 ProItemRefCount m_refCount;
432 QString m_proitems;
433 QString m_fileName;
434 QString m_directoryName;
435 int m_id;
436 bool m_ok;
437 bool m_hostBuild;
438};
439
441public:
442 ProFunctionDef(ProFile *pro, int offset) : m_pro(pro), m_offset(offset) { m_pro->ref(); }
443 ProFunctionDef(const ProFunctionDef &o) : m_pro(o.m_pro), m_offset(o.m_offset) { m_pro->ref(); }
445 : m_pro(other.m_pro), m_offset(other.m_offset) { other.m_pro = nullptr; }
446 ~ProFunctionDef() { if (m_pro) m_pro->deref(); }
448 {
449 if (this != &o) {
450 if (m_pro)
451 m_pro->deref();
452 m_pro = o.m_pro;
453 m_pro->ref();
454 m_offset = o.m_offset;
455 }
456 return *this;
457 }
459 {
460 ProFunctionDef moved(std::move(other));
461 swap(moved);
462 return *this;
463 }
464 void swap(ProFunctionDef &other) noexcept
465 {
466 qSwap(m_pro, other.m_pro);
467 qSwap(m_offset, other.m_offset);
468 }
469
470 ProFile *pro() const { return m_pro; }
471 const ushort *tokPtr() const { return m_pro->tokPtr() + m_offset; }
472private:
473 ProFile *m_pro;
474 int m_offset;
475};
476
478
483
484QDebug operator<<(QDebug debug, const ProString &str);
485
486QT_END_NAMESPACE
487
488#endif // PROITEMS_H
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
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
static void initialize()
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)
void deref()
Definition proitems.h:419
const ushort * tokPtrEnd() const
Definition proitems.h:416
QString fileName() const
Definition proitems.h:411
ProFile(int id, const QString &fileName)
Definition proitems.cpp:428
bool isHostBuild() const
Definition proitems.h:424
const ushort * tokPtr() const
Definition proitems.h:415
QString directoryName() const
Definition proitems.h:412
ProString getStr(const ushort *&tPtr)
Definition proitems.cpp:445
QString * itemsRef()
Definition proitems.h:414
const QString & items() const
Definition proitems.h:413
void ref()
Definition proitems.h:418
ProKey getHashStr(const ushort *&tPtr)
Definition proitems.cpp:454
void setHostBuild(bool host_build)
Definition proitems.h:425
void setOk(bool ok)
Definition proitems.h:422
int id() const
Definition proitems.h:410
bool isOk() const
Definition proitems.h:421
const ushort * tokPtr() const
Definition proitems.h:471
ProFunctionDef(ProFunctionDef &&other) noexcept
Definition proitems.h:444
ProFunctionDef(ProFile *pro, int offset)
Definition proitems.h:442
ProFile * pro() const
Definition proitems.h:470
void swap(ProFunctionDef &other) noexcept
Definition proitems.h:464
ProFunctionDef & operator=(ProFunctionDef &&other) noexcept
Definition proitems.h:458
ProFunctionDef(const ProFunctionDef &o)
Definition proitems.h:443
ProFunctionDef & operator=(const ProFunctionDef &o)
Definition proitems.h:447
ProItemRefCount(int cnt=0)
Definition proitems.h:24
ProItemRefCount & operator=(int value)
Definition proitems.h:27
void setValue(const QString &str)
Definition proitems.cpp:122
ProKey(const QString &str, int off, int len, uint hash)
Definition proitems.cpp:117
ALWAYS_INLINE const ProString & toString() const
Definition proitems.h:195
ProKey(const QStringBuilder< A, B > &str)
Definition proitems.h:176
ProKey(const QString &str)
Definition proitems.cpp:102
ALWAYS_INLINE ProKey()
Definition proitems.h:173
ALWAYS_INLINE ProString & toString()
Definition proitems.h:194
PROITEM_EXPLICIT ProKey(const char *str)
Definition proitems.cpp:107
ProKey(const QString &str, int off, int len)
Definition proitems.cpp:112
void removeAll(const ProString &str)
Definition proitems.cpp:344
bool contains(const QString &str, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Definition proitems.h:320
QString join(QChar sep) const
Definition proitems.cpp:339
void removeAt(int idx)
Definition proitems.h:314
QString join(const ProString &sep) const
Definition proitems.cpp:329
bool contains(const char *str, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Definition proitems.cpp:420
void removeAll(const char *str)
Definition proitems.cpp:351
void insertUnique(const ProStringList &value)
Definition proitems.cpp:381
QString join(const QStringBuilder< A, B > &str)
Definition proitems.h:307
QString join(const QString &sep) const
Definition proitems.cpp:334
int length() const
Definition proitems.h:301
void removeEmpty()
Definition proitems.cpp:368
bool contains(QStringView str, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Definition proitems.cpp:412
void removeEach(const ProStringList &value)
Definition proitems.cpp:358
ProStringList(const ProString &str)
Definition proitems.h:294
ProStringList(const QStringList &list)
Definition proitems.cpp:388
void removeDuplicates()
Definition proitems.cpp:375
bool contains(const ProString &str, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Definition proitems.cpp:404
QStringList toQStringList() const
Definition proitems.cpp:395
ProStringRoUser(const ProString &ps, QString &rs)
Definition proitems.h:252
ProStringRoUser(QString &rs)
Definition proitems.h:248
QString * m_rs
Definition proitems.h:264
QString & str()
Definition proitems.h:261
QString & set(const ProString &ps)
Definition proitems.h:260
ProStringRwUser(QString &rs)
Definition proitems.h:273
ProString extract(const QString &s) const
Definition proitems.h:278
QString & set(const ProString &ps)
Definition proitems.h:277
ProStringRwUser(const ProString &ps, QString &rs)
Definition proitems.h:275
ProString extract(const QString &s, const ProStringRwUser &other) const
Definition proitems.h:280
ProString & operator+=(const QLatin1String other)
Definition proitems.h:78
ProString & setSource(const ProString &other)
Definition proitems.h:61
QString & toQString(QString &tmp) const
Definition proitems.cpp:133
ProString & operator=(const ProString &)=default
bool startsWith(const ProString &sub, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Definition proitems.h:108
ALWAYS_INLINE const ProKey & toKey() const
Definition proitems.h:139
bool startsWith(QChar c, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Definition proitems.h:111
int indexOf(QChar c, int from=0, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Definition proitems.h:122
bool isEmpty() const
Definition proitems.h:96
bool isNull() const
Definition proitems.h:95
bool contains(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Definition proitems.h:126
ProString & operator=(const QStringBuilder< A, B > &str)
Definition proitems.h:49
QByteArray toLatin1() const
Definition proitems.h:144
bool operator<(const ProString &other) const
Definition proitems.h:94
ProString mid(int off, int len=-1) const
Definition proitems.cpp:268
bool operator==(const ProString &other) const
Definition proitems.h:85
int length() const
Definition proitems.h:97
int lastIndexOf(QChar c, int from=-1, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Definition proitems.h:125
QString toQString() const
Definition proitems.cpp:128
ProString(const QString &str)
Definition proitems.cpp:48
bool operator!=(const QString &other) const
Definition proitems.h:91
bool endsWith(const QStringBuilder< A, B > &str)
Definition proitems.h:118
ProString & append(const QLatin1String other)
Definition proitems.cpp:156
ALWAYS_INLINE QStringView toQStringView() const
Definition proitems.h:136
int toInt(bool *ok=nullptr, int base=10) const
Definition proitems.h:130
int indexOf(const QString &s, int from=0, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Definition proitems.h:120
void setValue(const QString &str)
Definition proitems.cpp:85
int size() const
Definition proitems.h:98
bool operator==(const char *other) const
Definition proitems.h:89
int compare(const QString &sub, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Definition proitems.h:106
ProString(const QString &str, int offset, int length)
Definition proitems.cpp:80
void clear()
Definition proitems.h:60
size_t hash() const
Definition proitems.h:133
ProString & operator+=(const ProString &other)
Definition proitems.h:74
int compare(const char *sub, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Definition proitems.h:107
bool operator!=(QLatin1String other) const
Definition proitems.h:92
int compare(const ProString &sub, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Definition proitems.h:105
ProString right(int len) const
Definition proitems.h:103
static size_t hash(const QChar *p, int n)
Definition proitems.cpp:15
ProString & prepend(const ProString &other)
Definition proitems.cpp:139
void chop(int n)
Definition proitems.h:82
ALWAYS_INLINE ProKey & toKey()
Definition proitems.h:138
int indexOf(const char *s, int from=0, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Definition proitems.h:121
qlonglong toLongLong(bool *ok=nullptr, int base=10) const
Definition proitems.h:129
ProString & append(const char *other)
Definition proitems.h:71
PROITEM_EXPLICIT ProString(QStringView str)
Definition proitems.cpp:53
int lastIndexOf(const QString &s, int from=-1, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Definition proitems.h:123
bool endsWith(const QString &sub, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Definition proitems.h:115
bool operator!=(const char *other) const
Definition proitems.h:93
bool contains(QChar c, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Definition proitems.h:128
const QChar * constData() const
Definition proitems.h:100
bool operator==(const QString &other) const
Definition proitems.h:86
int sourceFile() const
Definition proitems.h:63
ProString(const QStringBuilder< A, B > &str)
Definition proitems.h:55
bool startsWith(const QStringBuilder< A, B > &str)
Definition proitems.h:113
void chopFront(int n)
Definition proitems.h:83
bool startsWith(const char *sub, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Definition proitems.h:110
int lastIndexOf(const char *s, int from=-1, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Definition proitems.h:124
ProString & operator+=(const QString &other)
Definition proitems.h:75
ProString trimmed() const
Definition proitems.cpp:280
ProString & operator+=(const char *other)
Definition proitems.h:79
bool endsWith(const char *sub, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Definition proitems.h:116
QChar at(int i) const
Definition proitems.h:99
ProString left(int len) const
Definition proitems.h:102
ProString & append(const ProString &other, bool *pending=nullptr)
Definition proitems.cpp:189
bool endsWith(QChar c, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Definition proitems.h:119
ProString & append(const QString &other)
Definition proitems.h:67
ProString & append(const QStringBuilder< A, B > &other)
Definition proitems.h:69
bool contains(const char *s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Definition proitems.h:127
bool operator!=(const ProString &other) const
Definition proitems.h:90
ProString & operator+=(const QStringBuilder< A, B > &other)
Definition proitems.h:77
PROITEM_EXPLICIT ProString(const char *str)
Definition proitems.cpp:64
bool operator==(QStringView other) const
Definition proitems.h:87
bool endsWith(const ProString &sub, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Definition proitems.h:114
ProString & setSource(int id)
Definition proitems.h:62
ProString & append(const ProStringList &other, bool *pending=nullptr, bool skipEmpty1st=false)
Definition proitems.cpp:214
bool startsWith(const QString &sub, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Definition proitems.h:109
short toShort(bool *ok=nullptr, int base=10) const
Definition proitems.h:131
ProString(const ProString &other)
Definition proitems.cpp:32
\inmodule QtCore
Definition qhash.h:843
QMakeEvaluator * evaluator
QMakeBaseKey(const QString &_root, const QString &_stash, bool _hostBuild)
QString stash
QStringList configs[4]
QMakeCmdLineParserState(const QString &_pwd)
void useEnvironment()
QString user_template_prefix
QString cachefile
QStringList splitPathList(const QString &value) const
QString dir_sep
QString user_template
void setCommandLineArguments(const QString &pwd, const QStringList &args)
QString qtconf
QString qmakespec
void setProperties(const QHash< ProKey, ProString > &props)
void setDirectories(const QString &input_dir, const QString &output_dir)
QStringList qmake_args
QString dirlist_sep
QString expandEnvVars(const QString &str) const
QString xqmakespec
QString extra_cmds[4]
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
ReadResult readFile(int id, QString *contents, QString *errStr)
Definition qmakevfs.cpp:165
@ VfsCumulative
Definition qmakevfs.h:41
Definition qmap.h:295
Combined button and popup list for selecting options.
const QString & asString(const QString &s)
Definition qstring.h:1678
QDebug operator<<(QDebug debug, const ProString &str)
Definition proitems.cpp:464
size_t qHash(const ProString &str, size_t)
Definition proitems.cpp:95
QString operator+(const ProString &one, const ProString &two)
Definition proitems.cpp:251
Q_DECLARE_TYPEINFO(ProString, Q_RELOCATABLE_TYPE)
#define PROITEM_EXPLICIT
Definition proitems.h:34
QString & operator+=(QString &that, const ProString &other)
Definition proitems.h:236
ProToken
Definition proitems.h:332
@ TokAssign
Definition proitems.h:336
@ TokReplaceDef
Definition proitems.h:392
@ TokNewStr
Definition proitems.h:401
@ TokEnvVar
Definition proitems.h:360
@ TokLiteral
Definition proitems.h:345
@ TokFuncTerminator
Definition proitems.h:370
@ TokVariable
Definition proitems.h:352
@ TokAppend
Definition proitems.h:337
@ TokHashLiteral
Definition proitems.h:348
@ TokMask
Definition proitems.h:399
@ TokReplace
Definition proitems.h:340
@ TokBypassNesting
Definition proitems.h:396
@ TokLine
Definition proitems.h:334
@ TokNext
Definition proitems.h:377
@ TokBreak
Definition proitems.h:376
@ TokTestDef
Definition proitems.h:391
@ TokAnd
Definition proitems.h:379
@ TokRemove
Definition proitems.h:339
@ TokNot
Definition proitems.h:378
@ TokTestCall
Definition proitems.h:372
@ TokCondition
Definition proitems.h:371
@ TokBranch
Definition proitems.h:381
@ TokProperty
Definition proitems.h:356
@ TokArgSeparator
Definition proitems.h:369
@ TokTerminator
Definition proitems.h:333
@ TokOr
Definition proitems.h:380
@ TokFuncName
Definition proitems.h:363
@ TokQuoted
Definition proitems.h:400
@ TokAppendUnique
Definition proitems.h:338
@ TokValueTerminator
Definition proitems.h:344
@ TokForLoop
Definition proitems.h:386
@ TokReturn
Definition proitems.h:375
Q_DECLARE_TYPEINFO(ProStringList, Q_RELOCATABLE_TYPE)
Q_DECLARE_TYPEINFO(ProFunctionDef, Q_RELOCATABLE_TYPE)
QMap< ProKey, ProStringList > ProValueMap
Definition proitems.h:329
Q_DECLARE_TYPEINFO(ProKey, Q_RELOCATABLE_TYPE)
ProStringList operator+(const ProStringList &one, const ProStringList &two)
Definition proitems.h:326
static 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)
static QJsonValue toJsonValue(const QString &s)
static QJsonObject processProject(const QString &proFile, const QStringList &translationsVariables, ProFileGlobals *option, QMakeVfs *vfs, QMakeParser *parser, EvalHandler *evalHandler, ProFileEvaluator &visitor)
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 QStringList getResources(const QString &resourceFile, QMakeVfs *vfs)
static void setValue(QJsonObject &obj, const char *key, T value)
static QJsonArray processProjects(bool topLevel, const QStringList &proFiles, const QStringList &translationsVariables, const QHash< QString, QString > &outDirMap, ProFileGlobals *option, QMakeVfs *vfs, QMakeParser *parser, EvalHandler *evalHandler, bool *fail)
static std::optional< QJsonArray > generateProjectDescription(const QStringList &proFiles, const QStringList &translationsVariables, const QHash< QString, QString > &outDirMap, int proDebug, bool verbose)
#define ALWAYS_INLINE
#define QMAKE_EXPORT
bool operator==(const QMakeBaseKey &one, const QMakeBaseKey &two)
size_t qHash(const QMakeBaseKey &key, size_t seed=0)
QMakeEvalPhase
@ QMakeEvalBefore
@ QMakeEvalLate
@ QMakeEvalEarly
@ QMakeEvalAfter
#define qPrintable(string)
Definition qstring.h:1683
#define QStringLiteral(str)
Definition qstring.h:1825
QHash< ProKey, ProFunctionDef > replaceFunctions
Definition proitems.h:481
QHash< ProKey, ProFunctionDef > testFunctions
Definition proitems.h:480
static void appendTo(const ProString &a, QChar *&out)
Definition proitems.h:208
static int size(const ProString &a)
Definition proitems.h:207