Added basic method parameter handling

This commit is contained in:
Bartek Kryza
2021-03-18 19:58:27 +01:00
parent bffaa0a7d9
commit fcafef4b85
4 changed files with 81 additions and 3 deletions

View File

@@ -130,7 +130,17 @@ public:
if (m.type != "void")
type = m.type + " ";
ostr << to_string(m.scope) << type << m.name + "()";
ostr << to_string(m.scope) << type << m.name;
ostr << "(";
if (true) { // TODO: add option to disable parameter generation
std::vector<std::string> params;
std::transform(m.parameters.begin(), m.parameters.end(),
std::back_inserter(params),
[](const auto &mp) { return mp.to_string(); });
ostr << fmt::format("{}", fmt::join(params, ", "));
}
ostr << ")";
if (m.is_const)
ostr << " const";