diff options
| author | Nikolai Kosjar <[email protected]> | 2013-12-13 18:41:15 +0100 |
|---|---|---|
| committer | Nikolai Kosjar <[email protected]> | 2014-05-15 15:55:38 +0200 |
| commit | 126e69137a7b3cfdf86832c2561f1dde311e9ad6 (patch) | |
| tree | a884d65be6c50dfbd876091c295bfd0245f8f30d /src/libs/cplusplus/FindUsages.cpp | |
| parent | ba76baa65fa9ad4d1f3154639be385c7b49dc1dd (diff) | |
C++: Clarify units of a Token
This will avoid confusion when later more length and indices methods are
added.
In Token:
length() --> bytes()
begin() --> bytesBegin()
end() --> bytesEnd()
Change-Id: I244c69b022e239ee762b4114559e707f93ff344f
Reviewed-by: Erik Verbruggen <[email protected]>
Diffstat (limited to 'src/libs/cplusplus/FindUsages.cpp')
| -rw-r--r-- | src/libs/cplusplus/FindUsages.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libs/cplusplus/FindUsages.cpp b/src/libs/cplusplus/FindUsages.cpp index 383bd3dad7a..91fa156c2fe 100644 --- a/src/libs/cplusplus/FindUsages.cpp +++ b/src/libs/cplusplus/FindUsages.cpp @@ -140,7 +140,7 @@ void FindUsages::reportResult(unsigned tokenIndex, const QList<LookupItem> &cand QString FindUsages::matchingLine(const Token &tk) const { const char *beg = _source.constData(); - const char *cp = beg + tk.begin(); + const char *cp = beg + tk.bytesBegin(); for (; cp != beg - 1; --cp) { if (*cp == '\n') break; @@ -178,7 +178,7 @@ void FindUsages::reportResult(unsigned tokenIndex) if (col) --col; // adjust the column position. - const int len = tk.length(); + const int len = tk.bytes(); const Usage u(_doc->fileName(), lineText, line, col, len); _usages.append(u); @@ -259,8 +259,8 @@ bool FindUsages::checkCandidates(const QList<LookupItem> &candidates) const void FindUsages::checkExpression(unsigned startToken, unsigned endToken, Scope *scope) { - const unsigned begin = tokenAt(startToken).begin(); - const unsigned end = tokenAt(endToken).end(); + const unsigned begin = tokenAt(startToken).bytesBegin(); + const unsigned end = tokenAt(endToken).bytesEnd(); const QByteArray expression = _source.mid(begin, end - begin); // qDebug() << "*** check expression:" << expression; |
