Extended inja comment test case

This commit is contained in:
Bartek Kryza
2022-09-16 18:20:34 +02:00
parent d406991681
commit e45458de62
6 changed files with 65 additions and 16 deletions

View File

@@ -31,6 +31,21 @@ diagram::diagram(diagram &&) = default;
diagram &diagram::operator=(diagram &&) = default;
common::optional_ref<clanguml::common::model::diagram_element>
diagram::get_with_namespace(const std::string &name, const namespace_ &ns) const
{
auto element_opt = get(name);
if (!element_opt) {
// If no element matches, try to prepend the 'using_namespace'
// value to the element and search again
auto fully_qualified_name = ns | name;
element_opt = get(fully_qualified_name.to_string());
}
return element_opt;
}
std::string diagram::name() const { return name_; }
void diagram::set_name(const std::string &name) { name_ = name; }

View File

@@ -45,6 +45,11 @@ public:
virtual common::optional_ref<clanguml::common::model::diagram_element> get(
const diagram_element::id_t id) const = 0;
/// \brief Find element in diagram which can have full name or be
/// relative to ns
common::optional_ref<clanguml::common::model::diagram_element>
get_with_namespace(const std::string &name, const namespace_ &ns) const;
diagram(const diagram &) = delete;
diagram(diagram &&);
diagram &operator=(const diagram &) = delete;