diff --git a/src/puml/class_diagram_generator.h b/src/puml/class_diagram_generator.h index 7bc0c6a0..abef96dd 100644 --- a/src/puml/class_diagram_generator.h +++ b/src/puml/class_diagram_generator.h @@ -99,7 +99,7 @@ public: else ostr << "class "; - ostr << namespace_relative(m_config.using_namespace, c.name) << " {" + ostr << ns_relative(m_config.using_namespace, c.name) << " {" << std::endl; // @@ -149,9 +149,9 @@ public: } for (const auto &r : c.relationships) { - ostr << namespace_relative(m_config.using_namespace, c.name) << " " + ostr << ns_relative(m_config.using_namespace, c.name) << " " << to_string(r.type) << " " - << namespace_relative(m_config.using_namespace, r.destination); + << ns_relative(m_config.using_namespace, r.destination); if (!r.label.empty()) ostr << " : " << r.label; @@ -161,8 +161,8 @@ public: void generate(const enum_ &e, std::ostream &ostr) const { - ostr << "Enum " << namespace_relative(m_config.using_namespace, e.name) - << " {" << std::endl; + ostr << "Enum " << ns_relative(m_config.using_namespace, e.name) << " {" + << std::endl; for (const auto &enum_constant : e.constants) { ostr << enum_constant << std::endl; diff --git a/src/puml/sequence_diagram_generator.h b/src/puml/sequence_diagram_generator.h index 50ef04af..29950fea 100644 --- a/src/puml/sequence_diagram_generator.h +++ b/src/puml/sequence_diagram_generator.h @@ -65,8 +65,8 @@ public: void generate_call(const message &m, std::ostream &ostr) const { - const auto from = namespace_relative(m_config.using_namespace, m.from); - const auto to = namespace_relative(m_config.using_namespace, m.to); + const auto from = ns_relative(m_config.using_namespace, m.from); + const auto to = ns_relative(m_config.using_namespace, m.to); ostr << '"' << from << "\" " << "->" @@ -76,9 +76,8 @@ public: void generate_return(const message &m, std::ostream &ostr) const { if ((m.from != m.to) && (m.return_type != "void")) { - const auto from = - namespace_relative(m_config.using_namespace, m.from); - const auto to = namespace_relative(m_config.using_namespace, m.to); + const auto from = ns_relative(m_config.using_namespace, m.from); + const auto to = ns_relative(m_config.using_namespace, m.to); ostr << '"' << to << "\" " << "-->" @@ -89,7 +88,7 @@ public: void generate_activity(const activity &a, std::ostream &ostr) const { for (const auto &m : a.messages) { - const auto to = namespace_relative(m_config.using_namespace, m.to); + const auto to = ns_relative(m_config.using_namespace, m.to); generate_call(m, ostr); ostr << "activate " << '"' << to << '"' << std::endl; if (m_model.sequences.find(m.to_usr) != m_model.sequences.end()) diff --git a/src/util/util.h b/src/util/util.h index 148459d9..3a5ab466 100644 --- a/src/util/util.h +++ b/src/util/util.h @@ -47,7 +47,7 @@ std::vector split(std::string str, std::string delimiter) return result; } -std::string namespace_relative( +std::string ns_relative( const std::vector &namespaces, const std::string &n) { for (const auto &ns : namespaces) {