Add signature() to cpp_function_base
This commit is contained in:
parent
592eb0284f
commit
93d2c58f7f
8 changed files with 112 additions and 22 deletions
|
|
@ -35,6 +35,22 @@ cpp_entity_kind cpp_function_parameter::do_get_entity_kind() const noexcept
|
|||
return kind();
|
||||
}
|
||||
|
||||
std::string cpp_function_base::do_get_signature() const
|
||||
{
|
||||
std::string result = "(";
|
||||
for (auto& param : parameters())
|
||||
result += detail::to_string(param.type()) + ',';
|
||||
if (is_variadic())
|
||||
result += "...";
|
||||
|
||||
if (result.back() == ',')
|
||||
result.back() = ')';
|
||||
else
|
||||
result.push_back(')');
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
cpp_entity_kind cpp_function::kind() noexcept
|
||||
{
|
||||
return cpp_entity_kind::function_t;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue