Added 'title' diagram property
This commit is contained in:
@@ -494,6 +494,20 @@ struct SequenceDiagramAliasMatcher {
|
||||
};
|
||||
}
|
||||
|
||||
ContainsMatcher HasTitle(std::string const &str,
|
||||
CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes)
|
||||
{
|
||||
return ContainsMatcher(CasedString("title " + str, caseSensitivity));
|
||||
}
|
||||
|
||||
namespace mermaid {
|
||||
ContainsMatcher HasTitle(std::string const &str,
|
||||
CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes)
|
||||
{
|
||||
return ContainsMatcher(CasedString("title: " + str, caseSensitivity));
|
||||
}
|
||||
}
|
||||
|
||||
ContainsMatcher IsClass(std::string const &str,
|
||||
CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes)
|
||||
{
|
||||
@@ -1231,6 +1245,11 @@ std::string expand_name(const nlohmann::json &j, const std::string &name)
|
||||
return fmt::format("{}::{}", j["using_namespace"].get<std::string>(), name);
|
||||
}
|
||||
|
||||
bool HasTitle(const nlohmann::json &j, const std::string &title)
|
||||
{
|
||||
return j.contains("title") && j["title"] == title;
|
||||
}
|
||||
|
||||
bool IsClass(const nlohmann::json &j, const std::string &name)
|
||||
{
|
||||
auto e = get_element(j, expand_name(j, name));
|
||||
|
||||
Reference in New Issue
Block a user