forked from qt-creator/qt-creator
CPlusPlus: Use QVector<Token> instead of QList
Better suited to avoid the indirection (sizeof(Token) > sizeof(void *)) Change-Id: Ia5f42781e720ef6aa8161f8f81ae8ddd8e58c837 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
This commit is contained in:
@@ -34,12 +34,13 @@
|
||||
#include <cplusplus/Token.h>
|
||||
|
||||
#include <QString>
|
||||
#include <QList>
|
||||
#include <QVector>
|
||||
|
||||
namespace CPlusPlus {
|
||||
|
||||
class SimpleLexer;
|
||||
class Token;
|
||||
typedef QVector<Token> Tokens;
|
||||
|
||||
class CPLUSPLUS_EXPORT SimpleLexer
|
||||
{
|
||||
@@ -55,18 +56,18 @@ public:
|
||||
|
||||
bool endedJoined() const;
|
||||
|
||||
QList<Token> operator()(const QString &text, int state = 0);
|
||||
Tokens operator()(const QString &text, int state = 0);
|
||||
|
||||
int state() const
|
||||
{ return _lastState; }
|
||||
|
||||
static int tokenAt(const QList<Token> &tokens, unsigned utf16charsOffset);
|
||||
static int tokenAt(const Tokens &tokens, unsigned utf16charsOffset);
|
||||
static Token tokenAt(const QString &text,
|
||||
unsigned utf16charsOffset,
|
||||
int state,
|
||||
bool qtMocRunEnabled = false);
|
||||
|
||||
static int tokenBefore(const QList<Token> &tokens, unsigned utf16charsOffset);
|
||||
static int tokenBefore(const Tokens &tokens, unsigned utf16charsOffset);
|
||||
|
||||
private:
|
||||
int _lastState;
|
||||
|
||||
Reference in New Issue
Block a user