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

@@ -29,6 +29,7 @@ namespace YAML {
using clanguml::common::namespace_or_regex;
using clanguml::common::string_or_regex;
using clanguml::common::model::access_t;
using clanguml::common::model::module_access_t;
using clanguml::common::model::relationship_t;
using clanguml::config::callee_type;
using clanguml::config::class_diagram;
@@ -241,6 +242,23 @@ template <> struct convert<access_t> {
}
};
//
// config module_access_t decoder
//
template <> struct convert<module_access_t> {
static bool decode(const Node &node, module_access_t &rhs)
{
if (node.as<std::string>() == "public")
rhs = module_access_t::kPublic;
else if (node.as<std::string>() == "private")
rhs = module_access_t::kPrivate;
else
return false;
return true;
}
};
//
// config method_type decoder
//
@@ -483,6 +501,10 @@ template <> struct convert<filter> {
rhs.modules.push_back({ns});
}
if (node["module_access"])
rhs.module_access =
node["module_access"].as<decltype(rhs.module_access)>();
if (node["relationships"])
rhs.relationships =
node["relationships"].as<decltype(rhs.relationships)>();