language/duchain
KDevelop::Identifier Class Reference
Represents a single unqualified identifier. More...
#include <identifier.h>
Public Member Functions | |
| Identifier (uint index) | |
| Identifier (const Identifier &rhs) | |
| Identifier (const IndexedString &str) | |
| Identifier (const QString &str, uint start=0, uint *takenRange=0) | |
| void | appendTemplateIdentifier (const IndexedTypeIdentifier &identifier) |
| void | clearTemplateIdentifiers () |
| uint | hash () const |
| const IndexedString | identifier () const |
| uint | index () const |
| bool | isEmpty () const |
| bool | isUnique () const |
| bool | nameEquals (const Identifier &rhs) const |
| bool | operator!= (const Identifier &rhs) const |
| Identifier & | operator= (const Identifier &rhs) |
| bool | operator== (const Identifier &rhs) const |
| void | setIdentifier (const IndexedString &identifier) |
| void | setIdentifier (const QString &identifier) |
| void | setTemplateIdentifiers (const QList< IndexedTypeIdentifier > &templateIdentifiers) |
| void | setUnique (int token) |
| IndexedTypeIdentifier | templateIdentifier (int num) const |
| uint | templateIdentifiersCount () const |
| QString | toString () const |
| int | uniqueToken () const |
Static Public Member Functions | |
| static Identifier | unique (int token) |
Friends | |
| kdbgstream & | operator<< (kdbgstream &s, const Identifier &identifier) |
Detailed Description
Represents a single unqualified identifier.
Definition at line 114 of file identifier.h.
Constructor & Destructor Documentation
| KDevelop::Identifier::Identifier | ( | const QString & | str, | |
| uint | start = 0, |
|||
| uint * | takenRange = 0 | |||
| ) | [explicit] |
- Parameters:
-
start The position in the given string where to start searching for the identifier(optional). takenRange If this is nonzero, it will be filled with the length of the range from the beginning of the given string, that was used to construct this identifier.(optional)
- Warning:
- The identifier is parsed in a C++-similar way, and the result may not be what you expect. If you want to prevent that parsing, use the constructor that takes IndexedString.
Extract template-parameters
Definition at line 333 of file identifier.cpp.
| KDevelop::Identifier::Identifier | ( | const IndexedString & | str | ) | [explicit] |
Preferred constructor, ise this if you already have an IndexedString available. This does not decompose the given string.
Definition at line 326 of file identifier.cpp.
Member Function Documentation
| uint KDevelop::Identifier::index | ( | ) | const |
Returns a unique index within the global identifier repository for this identifier.
If the identifier isn't in the repository yet, it is added to the repository.
Definition at line 430 of file identifier.cpp.
| bool KDevelop::Identifier::nameEquals | ( | const Identifier & | rhs | ) | const |
Comparison ignoring the template-identifiers.
Definition at line 308 of file identifier.cpp.
| void KDevelop::Identifier::setUnique | ( | int | token | ) |
If token is non-zero, turns this Identifier into the special per-document Unique identifier, used for anonymous namespaces.
Pass a token which is specific to the document to allow correct equality comparison.
Definition at line 376 of file identifier.cpp.
Friends And Related Function Documentation
| kdbgstream& operator<< | ( | kdbgstream & | s, | |
| const Identifier & | identifier | |||
| ) | [friend] |
kDebug(9505) stream operator.
Writes this identifier to the debug output in a nicely formatted way.
Definition at line 177 of file identifier.h.
The documentation for this class was generated from the following files:
KDE 4.4 API Reference