From 88b7a14a7973058248874f9a4d3dbcb181bcd352 Mon Sep 17 00:00:00 2001 From: Roberto Raggi <qtc-committer@nokia.com> Date: Tue, 9 Dec 2008 09:42:17 +0100 Subject: [PATCH] Added the methods to get all the identifiers used in a translation unit. --- shared/cplusplus/Control.cpp | 6 ++++++ shared/cplusplus/Control.h | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/shared/cplusplus/Control.cpp b/shared/cplusplus/Control.cpp index c994dbab9a2..a486dfdb940 100644 --- a/shared/cplusplus/Control.cpp +++ b/shared/cplusplus/Control.cpp @@ -511,6 +511,12 @@ Identifier *Control::findOrInsertIdentifier(const char *chars) return findOrInsertIdentifier(chars, length); } +Control::IdentifierIterator Control::firstIdentifier() const +{ return d->identifiers.begin(); } + +Control::IdentifierIterator Control::lastIdentifier() const +{ return d->identifiers.end(); } + StringLiteral *Control::findOrInsertStringLiteral(const char *chars, unsigned size) { return d->stringLiterals.findOrInsertLiteral(chars, size); } diff --git a/shared/cplusplus/Control.h b/shared/cplusplus/Control.h index fa7b4faa502..bd4b204843f 100644 --- a/shared/cplusplus/Control.h +++ b/shared/cplusplus/Control.h @@ -151,6 +151,11 @@ public: Identifier *findOrInsertIdentifier(const char *chars, unsigned size); Identifier *findOrInsertIdentifier(const char *chars); + typedef const Identifier *const *IdentifierIterator; + + IdentifierIterator firstIdentifier() const; + IdentifierIterator lastIdentifier() const; + StringLiteral *findOrInsertStringLiteral(const char *chars, unsigned size); StringLiteral *findOrInsertStringLiteral(const char *chars); -- GitLab