Added nontype variadic instantiation support

This commit is contained in:
Bartek Kryza
2021-03-14 10:53:10 +01:00
parent 2033ca29c0
commit 0fc862332a
5 changed files with 87 additions and 9 deletions

View File

@@ -266,6 +266,40 @@ public:
return res;
}
std::vector<std::string> tokenize_template_parameters() const
{
const auto &toks = tokenize();
std::vector<std::string> res;
bool inside_template{false};
bool is_namespace{false};
for (const auto &tok : toks) {
auto t = clanguml::util::trim(tok);
if (t == ">") {
break;
}
if (inside_template) {
if (t == ",")
continue;
if (t == "::") {
is_namespace = true;
res.back() += t;
}
else if (is_namespace) {
is_namespace = false;
res.back() += t;
}
else {
res.push_back(t);
}
}
if (t == "<") {
inside_template = true;
}
}
return res;
}
const CXCursor &get() const { return m_cursor; }
private: