Added hyperlink generation in sequence diagrams

This commit is contained in:
Bartek Kryza
2022-12-10 16:34:36 +01:00
parent 3b6d999520
commit 310f311232
9 changed files with 72 additions and 32 deletions

View File

@@ -66,11 +66,23 @@ void translation_unit_visitor::process_comment(
void translation_unit_visitor::set_source_location(
const clang::Decl &decl, clanguml::common::model::source_location &element)
{
if (decl.getLocation().isValid()) {
element.set_file(source_manager_.getFilename(decl.getLocation()).str());
element.set_line(
source_manager_.getSpellingLineNumber(decl.getLocation()));
element.set_location_id(decl.getLocation().getHashValue());
set_source_location(decl.getLocation(), element);
}
void translation_unit_visitor::set_source_location(
const clang::Expr &expr, clanguml::common::model::source_location &element)
{
set_source_location(expr.getBeginLoc(), element);
}
void translation_unit_visitor::set_source_location(
const clang::SourceLocation &location,
clanguml::common::model::source_location &element)
{
if (location.isValid()) {
element.set_file(source_manager_.getFilename(location).str());
element.set_line(source_manager_.getSpellingLineNumber(location));
element.set_location_id(location.getHashValue());
}
}

View File

@@ -48,6 +48,12 @@ protected:
void set_source_location(const clang::Decl &decl,
clanguml::common::model::source_location &element);
void set_source_location(const clang::Expr &expr,
clanguml::common::model::source_location &element);
void set_source_location(const clang::SourceLocation &location,
clanguml::common::model::source_location &element);
void process_comment(const clang::NamedDecl &decl,
clanguml::common::model::decorated_element &e);