Added basic variadic template class support

This commit is contained in:
Bartek Kryza
2021-03-13 18:22:14 +01:00
parent 86945b11d4
commit ca9927ecc9
7 changed files with 109 additions and 3 deletions

View File

@@ -330,12 +330,16 @@ static enum CXChildVisitResult class_visitor(
ret = CXChildVisit_Continue;
break;
case CXCursor_TemplateTypeParameter: {
spdlog::info("Found template type parameter: {}: {}",
cursor.spelling(), cursor.type());
const auto &tokens = cursor.tokenize();
spdlog::info("Found template type parameter: {}: {}, [{}]", cursor,
cursor.type(), fmt::join(tokens, ", "));
class_template ct;
ct.type = "";
ct.name = cursor.spelling();
ct.default_value = "";
ct.is_variadic = tokens.size() > 2 && tokens[1] == "...";
ct.name = cursor.spelling();
if (ct.is_variadic)
ct.name += "...";
ctx->element.templates.emplace_back(std::move(ct));
ret = CXChildVisit_Continue;