Initial refactor of namespace handling

This commit is contained in:
Bartek Kryza
2022-03-04 23:38:18 +01:00
parent bee20e7f26
commit a67b459437
40 changed files with 620 additions and 201 deletions

View File

@@ -38,14 +38,16 @@ void method_parameter::set_default_value(const std::string &value)
std::string method_parameter::default_value() const { return default_value_; }
std::string method_parameter::to_string(
const std::vector<std::string> &using_namespaces) const
const common::model::namespace_ &using_namespace) const
{
using namespace clanguml::util;
auto t = ns_relative(using_namespaces, type());
auto type_ns = common::model::namespace_{type()}
.relative_to(using_namespace)
.to_string();
if (default_value().empty())
return fmt::format("{} {}", t, name());
return fmt::format("{} {}", type_ns, name());
return fmt::format("{} {} = {}", t, name(), default_value());
return fmt::format("{} {} = {}", type_ns, name(), default_value());
}
}