MCPcopy Create free account
hub / github.com/KDE/kdevelop / operator()

Method operator()

kdevplatform/language/duchain/topducontextutils.cpp:29–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27}
28
29bool TopDUContext::DeclarationChecker::operator()(const Declaration* decl) const
30{
31 if (!decl)
32 return false;
33
34 if (top != decl->topContext()) {
35 if (( flags& DUContext::OnlyFunctions ) && !dynamic_cast<const AbstractFunctionDeclaration*>(decl))
36 return false;
37
38 if (dataType && decl->abstractType()->indexed() != dataType->indexed())
39 // The declaration doesn't match the type filter we are applying
40 return false;
41 } else {
42 if (( flags& DUContext::OnlyFunctions ) && !dynamic_cast<const AbstractFunctionDeclaration*>(decl))
43 return false;
44
45 if (dataType && decl->abstractType() != dataType)
46 // The declaration doesn't match the type filter we are applying
47 return false;
48
49 if (decl->range().start >= position)
50 if (!decl->context() || decl->context()->type() != DUContext::Class)
51 return false; // The declaration is behind the position we're searching from, therefore not accessible
52 }
53 // Success, this declaration is accessible
54 return true;
55}

Callers

nothing calls this directly

Calls 6

topContextMethod · 0.45
indexedMethod · 0.45
abstractTypeMethod · 0.45
rangeMethod · 0.45
contextMethod · 0.45
typeMethod · 0.45

Tested by

no test coverage detected