Fixed package generation in class diagrams

This commit is contained in:
Bartek Kryza
2022-02-27 00:49:25 +01:00
parent 33c6a4b938
commit 17b0686f5c
6 changed files with 52 additions and 16 deletions

View File

@@ -169,6 +169,31 @@ bool diagram::should_include(const std::string &name_) const
return false;
}
bool diagram::should_include_package(const std::string &name) const
{
for (const auto &ex : exclude().namespaces) {
if (name.find(ex) == 0) {
LOG_DBG("Skipping from diagram: {}", name);
return false;
}
}
// If no inclusive namespaces are provided,
// allow all
if (include().namespaces.empty())
return true;
for (const auto &in : include().namespaces) {
if (in.find(name) == 0 || name.find(in) == 0)
return true;
}
LOG_DBG("Skipping from diagram: {}", name);
return false;
}
bool diagram::should_include(const clanguml::common::model::scope_t scope) const
{
for (const auto &s : exclude().scopes) {

View File

@@ -103,6 +103,8 @@ struct diagram : public inheritable_diagram_options {
bool should_include_relationship(const std::string &rel);
bool should_include_package(const std::string &name) const;
bool should_include(
const std::pair<std::vector<std::string>, std::string> &name) const;