Adds first successful release run (tbc)
This commit is contained in:
22 files changed
+89
-34
No files matched your search
@@ -88,7 +88,11 @@ bool LogViewTetraTelegramsParser::parse(const QString &filename)
|
||||
const QString content = QString::fromUtf8(f.readAll());
|
||||
f.close();
|
||||
|
||||
const QVector<QStringView> lines = content.splitView(QLatin1Char('\n'));
|
||||
const QStringList linesList = content.split(QLatin1Char('\n'));
|
||||
QVector<QStringView> lines;
|
||||
lines.reserve(linesList.size());
|
||||
for (const QString &line : linesList)
|
||||
lines += line;
|
||||
QVector<QStringView> linesTrimmed;
|
||||
linesTrimmed.reserve(lines.size());
|
||||
for (const QStringView &line : lines)
|
||||
@@ -213,7 +217,12 @@ int LogViewTetraTelegramsParser::parseStruct(const QVector<QStringView> &lines,
|
||||
QString structStr = QLatin1String("struct ") + si.type + QLatin1String("::") + tokens.at(0).toString() + QLatin1Char('\n') + hint.toString();
|
||||
structStr.replace(QLatin1Char(';'), QLatin1String(";\n"));
|
||||
DEBUG_LOG(m_logger) << "structStr: " << structStr;
|
||||
parseStruct(structStr.splitView(QLatin1Char('\n')), 0);
|
||||
const QStringList structLines = structStr.split(QLatin1Char('\n'));
|
||||
QVector<QStringView> structLinesView;
|
||||
structLinesView.reserve(structLines.size());
|
||||
for (const QString &line : structLines)
|
||||
structLinesView += line;
|
||||
parseStruct(structLinesView, 0);
|
||||
|
||||
mi.type = si.type + QLatin1String("::") + tokens.at(0).toString();
|
||||
mi.isArray = true;
|
||||
@@ -382,7 +391,7 @@ int LogViewTetraTelegramsParser::parseConstraint(const QVector<QStringView> &lin
|
||||
++i;
|
||||
continue;
|
||||
}
|
||||
const QVector<QStringView> parts = tokens.at(6).split(QLatin1String("::"));
|
||||
const QVector<QStringView> parts = tokens.at(6).split(u"::");
|
||||
if (parts.size() != 2)
|
||||
{
|
||||
WARNING_LOG(m_logger) << "Could not parse constraint: '" << lines.at(i).toString() << "'";
|
||||
@@ -451,6 +460,17 @@ static inline void bracketCount(const QStringView &str, int &cntLt, int &cntGt)
|
||||
QVector<QStringView> LogViewTetraTelegramsParser::tokenize(const QStringView &line) const
|
||||
{
|
||||
QVector<QStringView> ret = line.split(QLatin1Char(' '), Qt::SkipEmptyParts);
|
||||
|
||||
// Calculate positions for each token (Qt6 QStringView has no position() method)
|
||||
QVector<int> positions(ret.size());
|
||||
int currentPos = 0;
|
||||
for (int j = 0; j < ret.size(); ++j)
|
||||
{
|
||||
// Find position of this token in the original line
|
||||
positions[j] = line.indexOf(ret[j], currentPos);
|
||||
currentPos = positions[j] + ret[j].size();
|
||||
}
|
||||
|
||||
int i = 0;
|
||||
while (i < ret.size())
|
||||
{
|
||||
@@ -461,7 +481,7 @@ QVector<QStringView> LogViewTetraTelegramsParser::tokenize(const QStringView &li
|
||||
if (i == ret.size() - 1)
|
||||
break;
|
||||
const QStringView &lastToken = ret.last();
|
||||
const QStringView newToken = line.mid(token.position(), lastToken.position() - token.position() + lastToken.size());
|
||||
const QStringView newToken = line.mid(positions[i], positions.last() - positions[i] + lastToken.size());
|
||||
DEBUG_LOG(m_logger) << "New Token: " << newToken.toString();
|
||||
ret.resize(i + 1);
|
||||
ret[i] = newToken;
|
||||
@@ -478,7 +498,7 @@ QVector<QStringView> LogViewTetraTelegramsParser::tokenize(const QStringView &li
|
||||
continue;
|
||||
}
|
||||
const QStringView &nextToken = ret.at(i + 1);
|
||||
const QStringView newToken = line.mid(token.position(), nextToken.position() - token.position() + nextToken.size());
|
||||
const QStringView newToken = line.mid(positions[i], positions[i + 1] - positions[i] + nextToken.size());
|
||||
DEBUG_LOG(m_logger) << "New Token: " << newToken.toString();
|
||||
ret.removeAt(i + 1);
|
||||
ret[i] = newToken;
|
||||
|
||||
Reference in new issue
Block a user