Added handling of method parameters default values
This commit is contained in:
@@ -82,12 +82,15 @@ struct method_parameter {
|
||||
std::string name;
|
||||
std::string default_value;
|
||||
|
||||
std::string to_string() const
|
||||
std::string to_string(
|
||||
const std::vector<std::string> &using_namespaces) const
|
||||
{
|
||||
using namespace clanguml::util;
|
||||
auto t = ns_relative(using_namespaces, type);
|
||||
if (default_value.empty())
|
||||
return fmt::format("{} {}", type, name);
|
||||
return fmt::format("{} {}", t, name);
|
||||
|
||||
return fmt::format("{} {} = {}", type, name, default_value);
|
||||
return fmt::format("{} {} = {}", t, name, default_value);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -223,6 +223,7 @@ static enum CXChildVisitResult method_parameter_visitor(
|
||||
method_parameter mp;
|
||||
mp.name = cursor.spelling();
|
||||
mp.type = cursor.type().spelling();
|
||||
mp.default_value = cursor.default_value();
|
||||
|
||||
ctx->element.parameters.emplace_back(std::move(mp));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user