MCPcopy Create free account
hub / github.com/KDE/kdevelop / applyToIdentifier

Method applyToIdentifier

kdevplatform/language/duchain/instantiationinformation.cpp:20–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18DEFINE_LIST_MEMBER_HASH(InstantiationInformation, templateParameters, IndexedType)
19
20QualifiedIdentifier InstantiationInformation::applyToIdentifier(const QualifiedIdentifier& id) const
21{
22 QualifiedIdentifier ret;
23 if (id.count() > 1) {
24 ret = id;
25 ret.pop();
26 if (previousInstantiationInformation.index())
27 ret = previousInstantiationInformation.information().applyToIdentifier(ret);
28 }
29
30 Identifier lastId(id.last());
31
32 KDevVarLengthArray<IndexedTypeIdentifier> oldTemplateIdentifiers;
33 for (uint a = 0; a < lastId.templateIdentifiersCount(); ++a)
34 oldTemplateIdentifiers.append(lastId.templateIdentifier(a));
35
36 lastId.clearTemplateIdentifiers();
37
38 for (uint a = 0; a < templateParametersSize(); ++a) {
39 if (templateParameters()[a].abstractType()) {
40 lastId.appendTemplateIdentifier(IndexedTypeIdentifier(templateParameters()[a].abstractType()->toString(),
41 true));
42 } else {
43 lastId.appendTemplateIdentifier(
44 ( uint ) oldTemplateIdentifiers.size() > a ? oldTemplateIdentifiers[a] : IndexedTypeIdentifier());
45 }
46 }
47
48 for (int a = templateParametersSize(); a < oldTemplateIdentifiers.size(); ++a)
49 lastId.appendTemplateIdentifier(oldTemplateIdentifiers[a]);
50
51 ret.push(lastId);
52 return ret;
53}
54
55void InstantiationInformation::addTemplateParameter(const KDevelop::AbstractType::Ptr& type)
56{

Callers 1

qualifiedIdentifierMethod · 0.80

Calls 14

templateIdentifierMethod · 0.80
countMethod · 0.45
popMethod · 0.45
indexMethod · 0.45
lastMethod · 0.45
appendMethod · 0.45
abstractTypeMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected