| 18 | DEFINE_LIST_MEMBER_HASH(InstantiationInformation, templateParameters, IndexedType) |
| 19 | |
| 20 | QualifiedIdentifier 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 | |
| 55 | void InstantiationInformation::addTemplateParameter(const KDevelop::AbstractType::Ptr& type) |
| 56 | { |
no test coverage detected