Added module_access diagram filter (#101)

This commit is contained in:
Bartek Kryza
2023-12-19 22:16:18 +01:00
parent c51ae5b6ee
commit f09edd8b47
16 changed files with 189 additions and 5 deletions

View File

@@ -23,6 +23,14 @@
namespace clanguml::class_diagram::model {
using nlohmann::json;
void set_module(nlohmann::json &j, const common::model::element &e)
{
if (e.module()) {
j["module"]["name"] = e.module().value();
j["module"]["is_private"] = e.module_private();
}
}
void to_json(nlohmann::json &j, const class_element &c)
{
j["name"] = c.name();
@@ -94,6 +102,8 @@ void to_json(nlohmann::json &j, const class_ &c)
j["methods"] = c.methods();
j["bases"] = c.parents();
set_module(j, c);
j["template_parameters"] = c.template_params();
}
@@ -102,6 +112,8 @@ void to_json(nlohmann::json &j, const enum_ &c)
j = dynamic_cast<const common::model::element &>(c);
j["is_nested"] = c.is_nested();
j["constants"] = c.constants();
set_module(j, c);
}
void to_json(nlohmann::json &j, const concept_ &c)
@@ -109,6 +121,8 @@ void to_json(nlohmann::json &j, const concept_ &c)
j = dynamic_cast<const common::model::element &>(c);
j["parameters"] = c.requires_parameters();
j["statements"] = c.requires_statements();
set_module(j, c);
}
} // namespace clanguml::class_diagram::model