Doxygen
|
Helper class to find a class definition or check if A symbol is accessible in a given scope. More...
#include <src/symbolresolver.h>
Classes | |
struct | Private |
Public Member Functions | |
SymbolResolver (const FileDef *fileScope=nullptr) | |
~SymbolResolver () | |
const ClassDef * | resolveClass (const Definition *scope, const QCString &name, bool maybeUnlinkable=false, bool mayBeHidden=false) |
Find the class definition matching name within the scope set. | |
ClassDefMutable * | resolveClassMutable (const Definition *scope, const QCString &name, bool mayBeUnlinkable=false, bool mayBeHidden=false) |
Wrapper around resolveClass that returns a mutable interface to the class object or a nullptr if the symbol is immutable. | |
const Definition * | resolveSymbol (const Definition *scope, const QCString &name, const QCString &args=QCString(), bool checkCV=false, bool insideCode=false) |
Find the symbool definition matching name within the scope set. | |
int | isAccessibleFrom (const Definition *scope, const Definition *item) |
Checks if symbol item is accessible from within scope. | |
int | isAccessibleFromWithExpScope (const Definition *scope, const Definition *item, const QCString &explicitScopePart) |
Check if symbol item is accessible from within scope, where it has to match the explicitScopePart. | |
void | setFileScope (const FileDef *fd) |
Sets or updates the file scope using when resolving symbols. | |
const MemberDef * | getTypedef () const |
In case a call to resolveClass() resolves to a type member (e.g. | |
QCString | getTemplateSpec () const |
In case a call to resolveClass() points to a template specialization, the template part is return via this method. | |
QCString | getResolvedType () const |
In case a call to resolveClass() points to a typedef or using declaration. | |
Private Attributes | |
std::unique_ptr< Private > | p |
Helper class to find a class definition or check if A symbol is accessible in a given scope.
Definition at line 31 of file symbolresolver.h.
|
explicit |
Definition at line 1567 of file symbolresolver.cpp.
References p.
SymbolResolver::~SymbolResolver | ( | ) |
Definition at line 1572 of file symbolresolver.cpp.
QCString SymbolResolver::getResolvedType | ( | ) | const |
In case a call to resolveClass() points to a typedef or using declaration.
The type name it resolved to is returned via this method.
Definition at line 1682 of file symbolresolver.cpp.
References p.
Referenced by getCanonicalTypeForIdentifier(), and SymbolResolver::Private::getResolvedTypeRec().
QCString SymbolResolver::getTemplateSpec | ( | ) | const |
In case a call to resolveClass() points to a template specialization, the template part is return via this method.
Definition at line 1677 of file symbolresolver.cpp.
References p.
Referenced by findClassRelation(), and getCanonicalTypeForIdentifier().
const MemberDef * SymbolResolver::getTypedef | ( | ) | const |
In case a call to resolveClass() resolves to a type member (e.g.
an enum) this method will return it.
Definition at line 1672 of file symbolresolver.cpp.
References p.
Referenced by findClassRelation(), getCanonicalTypeForIdentifier(), getDefsOld(), and if().
int SymbolResolver::isAccessibleFrom | ( | const Definition * | scope, |
const Definition * | item ) |
Checks if symbol item is accessible from within scope.
Definition at line 1641 of file symbolresolver.cpp.
References AUTO_TRACE, AUTO_TRACE_EXIT, Definition::name(), and p.
Referenced by SymbolResolver::Private::isAccessibleFrom(), SymbolResolver::Private::isAccessibleFromWithExpScope(), and resolveTypeDef().
int SymbolResolver::isAccessibleFromWithExpScope | ( | const Definition * | scope, |
const Definition * | item, | ||
const QCString & | explicitScopePart ) |
Check if symbol item is accessible from within scope, where it has to match the explicitScopePart.
Definition at line 1653 of file symbolresolver.cpp.
References AUTO_TRACE, AUTO_TRACE_EXIT, Definition::name(), and p.
Referenced by getMemberFromSymbol(), SymbolResolver::Private::getResolvedSymbol(), SymbolResolver::Private::getResolvedType(), SymbolResolver::Private::isAccessibleFromWithExpScope(), and SymbolResolver::Private::substTypedef().
const ClassDef * SymbolResolver::resolveClass | ( | const Definition * | scope, |
const QCString & | name, | ||
bool | maybeUnlinkable = false, | ||
bool | mayBeHidden = false ) |
Find the class definition matching name within the scope set.
scope | The scope to search from. |
name | The name of the symbol. |
maybeUnlinkable | include unlinkable symbols in the search. |
mayBeHidden | include hidden symbols in the search. |
Definition at line 1577 of file symbolresolver.cpp.
References AUTO_TRACE, AUTO_TRACE_ADD, AUTO_TRACE_EXIT, Config_getBool, Definition::definitionType(), getClass(), Definition::getLanguage(), Doxygen::globalScope, Definition::isHidden(), Definition::isLinkable(), Java, Definition::name(), p, QCString::startsWith(), QCString::stripWhiteSpace(), Definition::TypeClass, and Definition::TypeNamespace.
Referenced by findClassDefinition(), findClassWithinClassContext(), findUsingDeclImports(), getCanonicalTypeForIdentifier(), getDefsOld(), if(), isVarWithConstructor(), normalizeNonTemplateArgumentsInString(), and resolveClassMutable().
|
inline |
Wrapper around resolveClass that returns a mutable interface to the class object or a nullptr if the symbol is immutable.
Definition at line 57 of file symbolresolver.h.
References resolveClass(), and toClassDefMutable().
Referenced by ClassDefImpl::addTypeConstraint(), findClassRelation(), findUsedClassesForClass(), and resolveTemplateInstanceInType().
const Definition * SymbolResolver::resolveSymbol | ( | const Definition * | scope, |
const QCString & | name, | ||
const QCString & | args = QCString(), | ||
bool | checkCV = false, | ||
bool | insideCode = false ) |
Find the symbool definition matching name within the scope set.
scope | The scope to search from. |
name | The name of the symbol. |
args | Argument list associated with the symbol (for functions) |
checkCV | Check const/volatile qualifiers (for methods) |
insideCode | Is the symbol found in a code fragment |
Definition at line 1624 of file symbolresolver.cpp.
References AUTO_TRACE, AUTO_TRACE_EXIT, Definition::definitionType(), Doxygen::globalScope, Definition::name(), p, qPrint(), Definition::qualifiedName(), toMemberDef(), and Definition::TypeMember.
Referenced by findUsingDeclarations(), findUsingDeclImports(), and getDefsNew().
void SymbolResolver::setFileScope | ( | const FileDef * | fd | ) |
Sets or updates the file scope using when resolving symbols.
Definition at line 1667 of file symbolresolver.cpp.
References p.
Referenced by getDefsNew().
|
private |
Definition at line 118 of file symbolresolver.h.
Referenced by getResolvedType(), getTemplateSpec(), getTypedef(), isAccessibleFrom(), isAccessibleFromWithExpScope(), resolveClass(), resolveSymbol(), setFileScope(), and SymbolResolver().