forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -86,7 +86,7 @@ void CppTodoItemsScanner::processDocument(CPlusPlus::Document::Ptr doc)
|
||||
|
||||
// Get comment source
|
||||
CPlusPlus::Token token = doc->translationUnit()->commentAt(i);
|
||||
QByteArray source = doc->utf8Source().mid(token.begin(), token.length()).trimmed();
|
||||
QByteArray source = doc->utf8Source().mid(token.bytesBegin(), token.bytes()).trimmed();
|
||||
|
||||
if ((token.kind() == CPlusPlus::T_COMMENT) || (token.kind() == CPlusPlus::T_DOXY_COMMENT)) {
|
||||
// Remove trailing "*/"
|
||||
@@ -98,7 +98,7 @@ void CppTodoItemsScanner::processDocument(CPlusPlus::Document::Ptr doc)
|
||||
const QStringList commentLines =
|
||||
QString::fromUtf8(source).split(QLatin1Char('\n'), QString::SkipEmptyParts);
|
||||
unsigned lineNumber = 0;
|
||||
translationUnit->getPosition(token.begin(), &lineNumber);
|
||||
translationUnit->getPosition(token.bytesBegin(), &lineNumber);
|
||||
for (int j = 0; j < commentLines.count(); ++j) {
|
||||
const QString &commentLine = commentLines.at(j);
|
||||
processCommentLine(doc->fileName(), commentLine, lineNumber + j, itemList);
|
||||
|
||||
Reference in New Issue
Block a user