Enabled adding notes to class methods and members (fixes #87)
This commit is contained in:
@@ -10,3 +10,9 @@ diagrams:
|
||||
include:
|
||||
namespaces:
|
||||
- clanguml::t00028
|
||||
plantuml:
|
||||
after:
|
||||
- >
|
||||
note left of {{ alias("R") }}::ccc
|
||||
Reference to C.
|
||||
end note
|
||||
|
||||
@@ -44,8 +44,10 @@ class R {
|
||||
{
|
||||
}
|
||||
|
||||
/// \uml{note[left] R contains an instance of A.}
|
||||
A aaa;
|
||||
|
||||
/// \uml{note:other_diagram[right] R contains an pointer to B.}
|
||||
B *bbb;
|
||||
|
||||
C &ccc;
|
||||
|
||||
@@ -54,6 +54,12 @@ note.)";
|
||||
REQUIRE_THAT(puml, HasNote(_A("F"), "bottom", "F enum note."));
|
||||
REQUIRE_THAT(puml, !HasNote(_A("G"), "left", "G class note."));
|
||||
REQUIRE_THAT(puml, HasNote(_A("R"), "right", "R class note."));
|
||||
REQUIRE_THAT(puml,
|
||||
HasMemberNote(_A("R"), "aaa", "left", "R contains an instance of A."));
|
||||
REQUIRE_THAT(
|
||||
puml, !HasMemberNote(_A("R"), "bbb", "right", "R class note."));
|
||||
REQUIRE_THAT(
|
||||
puml, HasMemberNote(_A("R"), "ccc", "left", "Reference to C."));
|
||||
|
||||
save_puml(config.output_directory() + "/" + diagram->name + ".puml", puml);
|
||||
}
|
||||
|
||||
@@ -438,6 +438,15 @@ ContainsMatcher HasNote(std::string const &cls, std::string const &position,
|
||||
fmt::format("note {} of {}", position, cls), caseSensitivity));
|
||||
}
|
||||
|
||||
ContainsMatcher HasMemberNote(std::string const &cls, std::string const &member,
|
||||
std::string const &position, std::string const ¬e = "",
|
||||
CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes)
|
||||
{
|
||||
return ContainsMatcher(
|
||||
CasedString(fmt::format("note {} of {}::{}", position, cls, member),
|
||||
caseSensitivity));
|
||||
}
|
||||
|
||||
ContainsMatcher HasLink(std::string const &alias, std::string const &link,
|
||||
std::string const &tooltip,
|
||||
CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes)
|
||||
|
||||
Reference in New Issue
Block a user