23{
25
26 std::string style;
27
28 const auto &inline_style = r.
style();
29
30 if (inline_style && !inline_style.value().empty()) {
31 if (inline_style && inline_style.value().back() == ']')
32 style = *inline_style;
33 else
34 style = fmt::format("[{}]", inline_style.value());
35 }
36
37 if (style.empty() && cfg.
puml) {
38 if (
auto config_style = cfg.
puml().get_style(r.
type());
39 config_style.has_value()) {
40 style = config_style.value();
41 }
42 }
43
45 case relationship_t::kOwnership:
46 case relationship_t::kComposition:
47 return style.empty() ? "*--" : fmt::format("*-{}-", style);
48 case relationship_t::kAggregation:
49 return style.empty() ? "o--" : fmt::format("o-{}-", style);
50 case relationship_t::kContainment:
51 return style.empty() ? "--+" : fmt::format("-{}-+", style);
52 case relationship_t::kAssociation:
53 return style.empty() ? "-->" : fmt::format("-{}->", style);
54 case relationship_t::kInstantiation:
55 return style.empty() ? "..|>" : fmt::format(".{}.|>", style);
56 case relationship_t::kFriendship:
57 return style.empty() ? "<.." : fmt::format("<.{}.", style);
58 case relationship_t::kDependency:
59 return style.empty() ? "..>" : fmt::format(".{}.>", style);
60 case relationship_t::kConstraint:
61 return style.empty() ? "..>" : fmt::format(".{}.>", style);
62 case relationship_t::kAlias:
63 return style.empty() ? ".." : fmt::format(".{}.", style);
64 default:
65 return "";
66 }
67}