forked from qt-creator/qt-creator
Debugger: Use QVarLengthArray for local buffer
Change-Id: I1bca338e0ffb850ca23bf5e1d1cd2fb85227ddda Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
#include <QString>
|
||||
#include <QJsonValue>
|
||||
#include <QJsonObject>
|
||||
#include <QVarLengthArray>
|
||||
#include <QVector>
|
||||
|
||||
#include <utils/filepath.h>
|
||||
@@ -105,6 +106,8 @@ class DebuggerOutputParser
|
||||
public:
|
||||
explicit DebuggerOutputParser(const QString &output);
|
||||
|
||||
using Buffer = QVarLengthArray<char, 30>;
|
||||
|
||||
QChar current() const { return *from; }
|
||||
bool isCurrent(QChar c) const { return *from == c; }
|
||||
bool isAtEnd() const { return from >= to; }
|
||||
@@ -116,6 +119,8 @@ public:
|
||||
int readInt();
|
||||
QChar readChar();
|
||||
QString readCString();
|
||||
void readCStringData(Buffer &buffer);
|
||||
|
||||
QStringView readString(const std::function<bool(char)> &isValidChar);
|
||||
|
||||
QStringView buffer() const { return QStringView(from, to - from); }
|
||||
|
||||
Reference in New Issue
Block a user