kdevplatform/language/duchain
#include <identifier.h>
Public Member Functions | |
Identifier () | |
Identifier (const Identifier &rhs) | |
Identifier (const IndexedString &str) | |
Identifier (const QString &str, uint start=0, uint *takenRange=nullptr) | |
Identifier (Identifier &&rhs) Q_DECL_NOEXCEPT | |
Identifier (uint index) | |
~Identifier () | |
void | appendTemplateIdentifier (const IndexedTypeIdentifier &identifier) |
void | clearTemplateIdentifiers () |
uint | hash () const |
const IndexedString | identifier () const |
uint | index () const |
bool | inRepository () const |
bool | isEmpty () const |
bool | isUnique () const |
bool | nameEquals (const Identifier &rhs) const |
bool | operator!= (const Identifier &rhs) const |
Identifier & | operator= (const Identifier &rhs) |
Identifier & | operator= (Identifier &&rhs) Q_DECL_NOEXCEPT |
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 (IdentifierStringFormattingOptions options=NoOptions) const |
int | uniqueToken () const |
Static Public Member Functions | |
static Identifier | unique (int token) |
Detailed Description
Represents a single unqualified identifier.
Definition at line 150 of file identifier.h.
Constructor & Destructor Documentation
◆ Identifier() [1/6]
|
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 382 of file identifier.cpp.
◆ Identifier() [2/6]
|
explicit |
Preferred constructor, use this if you already have an IndexedString available.
This does not decompose the given string.
Definition at line 370 of file identifier.cpp.
◆ Identifier() [3/6]
KDevelop::Identifier::Identifier | ( | const Identifier & | rhs | ) |
Definition at line 356 of file identifier.cpp.
◆ Identifier() [4/6]
|
explicit |
Definition at line 363 of file identifier.cpp.
◆ Identifier() [5/6]
KDevelop::Identifier::Identifier | ( | ) |
Definition at line 405 of file identifier.cpp.
◆ Identifier() [6/6]
KDevelop::Identifier::Identifier | ( | Identifier && | rhs | ) |
Definition at line 427 of file identifier.cpp.
◆ ~Identifier()
KDevelop::Identifier::~Identifier | ( | ) |
Definition at line 462 of file identifier.cpp.
Member Function Documentation
◆ appendTemplateIdentifier()
void KDevelop::Identifier::appendTemplateIdentifier | ( | const IndexedTypeIdentifier & | identifier | ) |
Definition at line 561 of file identifier.cpp.
◆ clearTemplateIdentifiers()
void KDevelop::Identifier::clearTemplateIdentifiers | ( | ) |
Definition at line 567 of file identifier.cpp.
◆ hash()
uint KDevelop::Identifier::hash | ( | ) | const |
Definition at line 473 of file identifier.cpp.
◆ identifier()
const IndexedString KDevelop::Identifier::identifier | ( | ) | const |
Definition at line 520 of file identifier.cpp.
◆ index()
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 573 of file identifier.cpp.
◆ inRepository()
bool KDevelop::Identifier::inRepository | ( | ) | const |
Definition at line 580 of file identifier.cpp.
◆ isEmpty()
bool KDevelop::Identifier::isEmpty | ( | ) | const |
Definition at line 481 of file identifier.cpp.
◆ isUnique()
bool KDevelop::Identifier::isUnique | ( | ) | const |
Definition at line 496 of file identifier.cpp.
◆ nameEquals()
bool KDevelop::Identifier::nameEquals | ( | const Identifier & | rhs | ) | const |
Comparison ignoring the template-identifiers.
Definition at line 468 of file identifier.cpp.
◆ operator!=()
bool KDevelop::Identifier::operator!= | ( | const Identifier & | rhs | ) | const |
Definition at line 616 of file identifier.cpp.
◆ operator=() [1/2]
Identifier & KDevelop::Identifier::operator= | ( | const Identifier & | rhs | ) |
Definition at line 411 of file identifier.cpp.
◆ operator=() [2/2]
Identifier & KDevelop::Identifier::operator= | ( | Identifier && | rhs | ) |
Definition at line 439 of file identifier.cpp.
◆ operator==()
bool KDevelop::Identifier::operator== | ( | const Identifier & | rhs | ) | const |
Definition at line 611 of file identifier.cpp.
◆ setIdentifier() [1/2]
void KDevelop::Identifier::setIdentifier | ( | const IndexedString & | identifier | ) |
Should be preferred over the other version.
Definition at line 537 of file identifier.cpp.
◆ setIdentifier() [2/2]
void KDevelop::Identifier::setIdentifier | ( | const QString & | identifier | ) |
Definition at line 528 of file identifier.cpp.
◆ setTemplateIdentifiers()
void KDevelop::Identifier::setTemplateIdentifiers | ( | const QList< IndexedTypeIdentifier > & | templateIdentifiers | ) |
Definition at line 585 of file identifier.cpp.
◆ setUnique()
void KDevelop::Identifier::setUnique | ( | int | token | ) |
If token is non-zero, turns this Identifier into the special per-document unique identifier.
This is used e.g. for anonymous namespaces.
Pass a token which is specific to the document to allow correct equality comparison.
Definition at line 512 of file identifier.cpp.
◆ templateIdentifier()
IndexedTypeIdentifier KDevelop::Identifier::templateIdentifier | ( | int | num | ) | const |
- Warning
- This is expensive.
Definition at line 545 of file identifier.cpp.
◆ templateIdentifiersCount()
uint KDevelop::Identifier::templateIdentifiersCount | ( | ) | const |
Definition at line 553 of file identifier.cpp.
◆ toString()
QString KDevelop::Identifier::toString | ( | IdentifierStringFormattingOptions | options = NoOptions | ) | const |
Definition at line 594 of file identifier.cpp.
◆ unique()
|
static |
Definition at line 489 of file identifier.cpp.
◆ uniqueToken()
int KDevelop::Identifier::uniqueToken | ( | ) | const |
Definition at line 504 of file identifier.cpp.
Member Data Documentation
◆ cd
|
mutable |
Definition at line 236 of file identifier.h.
◆ dd
|
mutable |
Definition at line 235 of file identifier.h.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2021 The KDE developers.
Generated on Wed Jan 20 2021 23:38:35 by doxygen 1.8.16 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.