summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/cpprefactoringchanges.cpp
diff options
context:
space:
mode:
authorNikolai Kosjar <nikolai.kosjar@digia.com>2013-12-13 18:41:15 +0100
committerNikolai Kosjar <nikolai.kosjar@digia.com>2014-05-15 15:55:38 +0200
commit126e69137a7b3cfdf86832c2561f1dde311e9ad6 (patch)
treea884d65be6c50dfbd876091c295bfd0245f8f30d /src/plugins/cpptools/cpprefactoringchanges.cpp
parentba76baa65fa9ad4d1f3154639be385c7b49dc1dd (diff)
downloadqt-creator-126e69137a7b3cfdf86832c2561f1dde311e9ad6.tar.gz
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 <erik.verbruggen@digia.com>
Diffstat (limited to 'src/plugins/cpptools/cpprefactoringchanges.cpp')
-rw-r--r--src/plugins/cpptools/cpprefactoringchanges.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/plugins/cpptools/cpprefactoringchanges.cpp b/src/plugins/cpptools/cpprefactoringchanges.cpp
index 4b416d266d..553b905ac3 100644
--- a/src/plugins/cpptools/cpprefactoringchanges.cpp
+++ b/src/plugins/cpptools/cpprefactoringchanges.cpp
@@ -199,9 +199,9 @@ ChangeSet::Range CppRefactoringFile::range(unsigned tokenIndex) const
{
const Token &token = tokenAt(tokenIndex);
unsigned line, column;
- cppDocument()->translationUnit()->getPosition(token.begin(), &line, &column);
+ cppDocument()->translationUnit()->getPosition(token.bytesBegin(), &line, &column);
const int start = document()->findBlockByNumber(line - 1).position() + column - 1;
- return ChangeSet::Range(start, start + token.length());
+ return ChangeSet::Range(start, start + token.bytes());
}
ChangeSet::Range CppRefactoringFile::range(AST *ast) const
@@ -212,7 +212,7 @@ ChangeSet::Range CppRefactoringFile::range(AST *ast) const
int CppRefactoringFile::startOf(unsigned index) const
{
unsigned line, column;
- cppDocument()->translationUnit()->getPosition(tokenAt(index).begin(), &line, &column);
+ cppDocument()->translationUnit()->getPosition(tokenAt(index).bytesBegin(), &line, &column);
return document()->findBlockByNumber(line - 1).position() + column - 1;
}
@@ -224,7 +224,7 @@ int CppRefactoringFile::startOf(const AST *ast) const
int CppRefactoringFile::endOf(unsigned index) const
{
unsigned line, column;
- cppDocument()->translationUnit()->getPosition(tokenAt(index).end(), &line, &column);
+ cppDocument()->translationUnit()->getPosition(tokenAt(index).bytesEnd(), &line, &column);
return document()->findBlockByNumber(line - 1).position() + column - 1;
}
@@ -239,9 +239,9 @@ void CppRefactoringFile::startAndEndOf(unsigned index, int *start, int *end) con
{
unsigned line, column;
Token token(tokenAt(index));
- cppDocument()->translationUnit()->getPosition(token.begin(), &line, &column);
+ cppDocument()->translationUnit()->getPosition(token.bytesBegin(), &line, &column);
*start = document()->findBlockByNumber(line - 1).position() + column - 1;
- *end = *start + token.length();
+ *end = *start + token.bytes();
}
QString CppRefactoringFile::textOf(const AST *ast) const