language/duchain
KDevelop::QualifiedIdentifier Class Reference
Represents a qualified identifier. More...
#include <identifier.h>
Public Types | |
| typedef uint | HashType |
Public Member Functions | |
| QualifiedIdentifier (uint index) | |
| QualifiedIdentifier (const QualifiedIdentifier &id) | |
| QualifiedIdentifier (const Identifier &id) | |
| QualifiedIdentifier (const QString &id, bool isExpression=false) | |
| const Identifier | at (int i) const |
| bool | beginsWith (const QualifiedIdentifier &other) const |
| void | clear () |
| int | count () const |
| bool | explicitlyGlobal () const |
| Identifier | first () const |
| HashType | hash () const |
| uint | index () const |
| bool | inRepository () const |
| bool | isEmpty () const |
| bool | isExpression () const |
| bool | isQualified () const |
| Identifier | last () const |
| QualifiedIdentifier | left (int len) const |
| QualifiedIdentifier | merge (const QualifiedIdentifier &base) const |
| QualifiedIdentifier | mid (int pos, int len=-1) const |
| bool | operator!= (const QualifiedIdentifier &rhs) const |
| QualifiedIdentifier | operator+ (const Identifier &rhs) const |
| QualifiedIdentifier | operator+ (const QualifiedIdentifier &rhs) const |
| QualifiedIdentifier & | operator+= (const Identifier &rhs) |
| QualifiedIdentifier & | operator+= (const QualifiedIdentifier &rhs) |
| QualifiedIdentifier & | operator= (const QualifiedIdentifier &rhs) |
| bool | operator== (const QualifiedIdentifier &rhs) const |
| void | pop () |
| void | push (const QualifiedIdentifier &id) |
| void | push (const Identifier &id) |
| void | setExplicitlyGlobal (bool eg) |
| void | setIsExpression (bool) |
| Identifier | top () const |
| QString | toString (bool ignoreExplicitlyGlobal=false) const |
| QStringList | toStringList () const |
Static Public Member Functions | |
| static void | findByHash (HashType hash, KDevVarLengthArray< QualifiedIdentifier > &target) |
Protected Member Functions | |
| void | makeConstant () const |
| void | prepareWrite () |
| bool | sameIdentifiers (const QualifiedIdentifier &rhs) const |
Protected Attributes | |
| union { | |
| const QualifiedIdentifierPrivate < false > * cd | |
| QualifiedIdentifierPrivate < true > * dd | |
| }; | |
| uint | m_index |
Friends | |
| kdbgstream & | operator<< (kdbgstream &s, const QualifiedIdentifier &identifier) |
Detailed Description
Represents a qualified identifier.
QualifiedIdentifier has it's hash-values stored, so using the hash-values is very efficient.
Definition at line 199 of file identifier.h.
Member Function Documentation
| bool KDevelop::QualifiedIdentifier::explicitlyGlobal | ( | ) | const |
- Todo:
- Remove this flag
Definition at line 710 of file identifier.cpp.
| void KDevelop::QualifiedIdentifier::findByHash | ( | HashType | hash, | |
| KDevVarLengthArray< QualifiedIdentifier > & | target | |||
| ) | [static] |
Finds all identifiers in the identifier-repository that have the given hash value.
Definition at line 804 of file identifier.cpp.
| uint KDevelop::QualifiedIdentifier::hash | ( | ) | const |
The hash does not respect explicitlyGlobal, only the real scope.
Definition at line 810 of file identifier.cpp.
| bool KDevelop::QualifiedIdentifier::inRepository | ( | ) | const |
Returns true if this qualified identifier is already in the persistent identifier repository.
Definition at line 524 of file identifier.cpp.
| bool KDevelop::QualifiedIdentifier::isExpression | ( | ) | const |
A flag that can be set by setIsExpression.
Definition at line 696 of file identifier.cpp.
| QualifiedIdentifier KDevelop::QualifiedIdentifier::left | ( | int | len | ) | const [inline] |
Copy the leftmost len number of identifiers.
- Parameters:
-
len The number of identifiers to copy, or if negative, the number of identifiers to omit from the right
Definition at line 231 of file identifier.h.
| QualifiedIdentifier KDevelop::QualifiedIdentifier::mid | ( | int | pos, | |
| int | len = -1 | |||
| ) | const |
- Parameters:
-
pos Position where to start the copy. len If this is -1, the whole following part will be returned.
Definition at line 913 of file identifier.cpp.
| bool KDevelop::QualifiedIdentifier::operator== | ( | const QualifiedIdentifier & | rhs | ) | const |
Computes the hash-value that would be created with a qualified identifier with hash-value.
- Parameters:
-
leftHash of size leftSize with appendIdentifier appended as an identifierThe comparison-operators do not respect explicitlyGlobal and isExpression, they only respect the real scope. This is for convenient use in hash-tables etc.
Definition at line 754 of file identifier.cpp.
| void KDevelop::QualifiedIdentifier::setIsExpression | ( | bool | is | ) |
Set the expression-flag, that can be retrieved by isExpression().
This flag is not respected while creating the hash-value and while operator==() comparison. It is respected while isSame(..) comparison.
Definition at line 704 of file identifier.cpp.
Friends And Related Function Documentation
| kdbgstream& operator<< | ( | kdbgstream & | s, | |
| const QualifiedIdentifier & | identifier | |||
| ) | [friend] |
kDebug(9505) stream operator.
Writes this identifier to the debug output in a nicely formatted way.
Definition at line 287 of file identifier.h.
The documentation for this class was generated from the following files:
KDE 4.4 API Reference