22 }
else if (begin < cur.begin && end > cur.
end) {
58 endOfLine =
data.length();
66 if (endOfComment == -1)
87 endOfLine =
data.length();
94 if (endOfComment == -1)
110 for (
int i = 0;
i < lines.
size();
i++) {
170 QString begin =
data.mid(endOfProvider + 1, classMarker - endOfProvider - 1);
171 QString end =
data.
mid(classMarker + 2, beginOfFunctionMarker - classMarker - 2);
173 if (spaceIndex == -1)
176 func.className =
begin.mid(spaceIndex + 1,
begin.length() - spaceIndex - 1);
179 if (spaceIndex < braceIndex)
180 func.functionName =
end.left(spaceIndex).simplified();
182 func.functionName =
end.left(braceIndex).simplified();
185 func.functionParameters =
end.mid(braceIndex + 1, lastBraceIndex - braceIndex - 1).simplified();
204 if (endOfPoint == -1 || endOfPoint2 < endOfPoint) {
205 endOfPoint = endOfPoint2;
229 prefix =
data.
mid(endOfProvider + 1, endOfPoint - endOfProvider - 1).
simplified();
246 DEBUGPRINTF(printf(
"Cannot open '%s' for reading: %s\n",
260 for (
int i = 0;
i <
split.size() - 1;
i++) {
264 while (
m.hasNext() && !found) {
272 if (
match.hasCaptured(3)) {
290 while (
m.hasNext()) {
304 for (
const auto &
e : enums) {
305 const auto trimmed =
e.trimmed();
346 return elem.name == val;
349 cur =
r.value =
iter->value;
377 metadata =
data.
mid(endOfProvider + 1, endOfPoint - endOfProvider - 1).
simplified();
388 while (
i.hasNext()) {
391 int cur =
match.capturedStart();
403 while (
r.hasNext()) {
411 const auto enumOrFlag =
match.captured(1);
426 for (
int i = 0;
i < ranges.size() / 2;
i++) {
427 bool rangeFound =
false;
428 for (
auto &
v : moreValues) {
429 if (
v.name == ranges[2 *
i]) {
431 QString rangeEnd = ranges[2 *
i + 1];
432 auto iter = std::find_if(moreValues.begin(), moreValues.end(), [&rangeEnd](
const EnumNameValue &elem){
433 return elem.name == rangeEnd;
435 if (
iter != moreValues.end())
442 if (rangeFound ==
false)
447 return a.value < b.value;
450 int prevValue = std::as_const(moreValues).front().value;
451 for (
const auto &
v : std::as_const(moreValues)) {
453 if (
v.valueStr.isNull()) {
454 if (
v.value == prevValue + 1 && !
flags)
497 DEBUGPRINTF(printf(
"Cannot open '%s' for reading: %s\n",
510 while (
i.hasNext()) {
555 while (
i.hasNext()) {
570 while (
i.hasNext()) {
588 func.functionParameters.replace(rep.in, rep.out);
598 out << prefix <<
"\n";
604 out <<
func.className <<
"_" <<
func.functionName <<
"_entry(" <<
func.functionParameters <<
")\n";
605 out <<
func.className <<
"_" <<
func.functionName <<
"_exit()\n";
608 out << point.name <<
"(" << point.parameters <<
")\n";
QList< IncludePath > includes
QList< QString > m_metadata
int lineNumber(qsizetype offset) const
void addIncludesRecursive(const QString &filename, QStringList &includes)
void parseParamReplace(const QString &data, qsizetype offset, const QString &name)
void parse(QIODevice &input, const QString &name)
QList< QString > m_includeDirs
void parseMetadata(const QString &data, qsizetype offset, const QStringList &includes)
QList< Replace > m_replaces
void parsePrefix(const QString &data, qsizetype offset)
void write(QIODevice &input) const
QList< QString > m_prefixes
QString resolveInclude(const QString &filename)
QStringList findEnumValues(const QString &name, const QStringList &includes)
void parseInstrument(const QString &data, qsizetype offset)
void parsePoint(const QString &data, qsizetype offset)
QList< Function > m_functions
QList< LineNumber > m_offsets
bool startsWith(QByteArrayView other) const noexcept
constexpr bool isEmpty() const noexcept
constexpr QByteArrayView left(qsizetype n) const
\inmodule QtCore \reentrant
QString fileName() const
Returns the name of the file, excluding the path.
QString absoluteFilePath() const
Returns an absolute path including the file name.
QString absolutePath() const
Returns a file's path absolute path.
bool exists() const
Returns true if the file exists; otherwise returns false.
\inmodule QtCore \reentrant
qsizetype size() const noexcept
void push_back(parameter_type t)
const_reference at(qsizetype i) const noexcept
void append(parameter_type t)
\inmodule QtCore \reentrant
\inmodule QtCore \reentrant
QString captured(int nth=0) const
Returns the substring captured by the nth capturing group.
\inmodule QtCore \reentrant
QRegularExpressionMatchIterator globalMatch(const QString &subject, qsizetype offset=0, MatchType matchType=NormalMatch, MatchOptions matchOptions=NoMatchOption) const
Attempts to perform a global match of the regular expression against the given subject string,...
\macro QT_RESTRICTED_CAST_FROM_ASCII
QString right(qsizetype n) const
Returns a substring that contains the n rightmost characters of the string.
iterator begin()
Returns an \l{STL-style iterators}{STL-style iterator} pointing to the first character in the string.
bool startsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string starts with s; otherwise returns false.
QStringList split(const QString &sep, Qt::SplitBehavior behavior=Qt::KeepEmptyParts, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Splits the string into substrings wherever sep occurs, and returns the list of those strings.
QString mid(qsizetype position, qsizetype n=-1) const
Returns a string that contains n characters of this string, starting at the specified position index.
QString simplified() const &
iterator end()
Returns an \l{STL-style iterators}{STL-style iterator} pointing just after the last character in the ...
bool endsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string ends with s; otherwise returns false.
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
QString & append(QChar c)
QString left(qsizetype n) const
Returns a substring that contains the n leftmost characters of the string.
static QString static QString qsizetype indexOf(QChar c, qsizetype from=0, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
QString trimmed() const &
qsizetype length() const
Returns the number of characters in this string.
void panic(const char *fmt,...)
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter * iter
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLenum GLsizei GLsizei GLint * values
[15]
GLboolean GLboolean GLboolean b
GLsizei const GLfloat * v
[13]
GLboolean GLboolean GLboolean GLboolean a
[7]
GLenum GLenum GLsizei count
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum GLuint GLintptr offset
GLuint GLsizei const GLuint const GLintptr * offsets
GLenum GLenum GLenum input
static void split(QT_FT_Vector *b)
QtPrivate::QRegularExpressionMatchIteratorRangeBasedForIterator begin(const QRegularExpressionMatchIterator &iterator)
#define qPrintable(string)
#define QStringLiteral(str)
static bool match(const uchar *found, uint foundLen, const char *target, uint targetLen)
QFileInfo info(fileName)
[8]
QTextStream out(stdout)
[7]
\inmodule QtCore \reentrant
bool contains(const AT &t) const noexcept
static void removeOffsetRange(qsizetype begin, qsizetype end, QList< LineNumber > &offsets)
static void simplifyData(QString &data, QList< LineNumber > &offsets)
static QList< EnumNameValue > enumsToValues(const QStringList &values)
static bool findSpaceRange(const QString &data, qsizetype &offset, qsizetype &end)
static QString preprocessMetadata(const QString &in)