Fixed formatting
This commit is contained in:
@@ -107,8 +107,8 @@ private:
|
||||
|
||||
namespace std {
|
||||
template <>
|
||||
struct hash<std::reference_wrapper<
|
||||
const clanguml::class_diagram::model::class_>> {
|
||||
struct hash<
|
||||
std::reference_wrapper<const clanguml::class_diagram::model::class_>> {
|
||||
std::size_t operator()(const std::reference_wrapper<
|
||||
const clanguml::class_diagram::model::class_> &key) const
|
||||
{
|
||||
|
||||
@@ -245,7 +245,7 @@ bool translation_unit_visitor::VisitClassTemplateSpecializationDecl(
|
||||
// Check if the class was already processed within
|
||||
// VisitClassTemplateDecl()
|
||||
if (diagram_.has_element(cls->getID()))
|
||||
return true;
|
||||
return true;
|
||||
|
||||
// TODO: Add support for classes defined in function/method bodies
|
||||
if (cls->isLocalClass())
|
||||
|
||||
@@ -144,7 +144,8 @@ private:
|
||||
const clang::TemplateSpecializationType &template_instantiation_type);
|
||||
|
||||
void process_unexposed_template_specialization_parameters(
|
||||
const std::string &tspec, clanguml::class_diagram::model::template_parameter &tp,
|
||||
const std::string &tspec,
|
||||
clanguml::class_diagram::model::template_parameter &tp,
|
||||
clanguml::class_diagram::model::class_ &c);
|
||||
|
||||
bool find_relationships_in_unexposed_template_params(
|
||||
|
||||
@@ -67,7 +67,8 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
virtual bool should_include(const namespace_ &ns, const std::string &name) const;
|
||||
virtual bool should_include(
|
||||
const namespace_ &ns, const std::string &name) const;
|
||||
|
||||
private:
|
||||
std::string name_;
|
||||
|
||||
@@ -86,7 +86,7 @@ inja::json diagram_element::context() const
|
||||
bool operator==(const diagram_element &l, const diagram_element &r)
|
||||
{
|
||||
return l.id() == r.id();
|
||||
//return l.full_name(false) == r.full_name(false);
|
||||
// return l.full_name(false) == r.full_name(false);
|
||||
}
|
||||
|
||||
std::ostream &operator<<(std::ostream &out, const diagram_element &rhs)
|
||||
|
||||
@@ -34,8 +34,6 @@ namespace clanguml::common::model {
|
||||
|
||||
class element : public diagram_element, public source_location {
|
||||
public:
|
||||
|
||||
|
||||
element(const namespace_ &using_namespace);
|
||||
|
||||
virtual ~element() = default;
|
||||
|
||||
@@ -37,25 +37,26 @@ void generator::generate_relationships(
|
||||
|
||||
namespace plantuml_common = clanguml::common::generators::plantuml;
|
||||
|
||||
// if (f.type() == common::model::source_file_t::kDirectory) {
|
||||
// util::for_each(f, [this, &ostr](const auto &file) {
|
||||
// generate_relationships(
|
||||
// dynamic_cast<const source_file &>(*file), ostr);
|
||||
// });
|
||||
// }
|
||||
// else {
|
||||
// util::for_each_if(
|
||||
// f.relationships(),
|
||||
// [this](const auto &r) {
|
||||
// return m_model.should_include(r.type()) &&
|
||||
// util::contains(m_generated_aliases, r.destination());
|
||||
// },
|
||||
// [&f, &ostr](const auto &r) {
|
||||
// ostr << f.alias() << " "
|
||||
// << plantuml_common::to_plantuml(r.type(), r.style()) << " "
|
||||
// << r.destination() << '\n';
|
||||
// });
|
||||
// }
|
||||
// if (f.type() == common::model::source_file_t::kDirectory) {
|
||||
// util::for_each(f, [this, &ostr](const auto &file) {
|
||||
// generate_relationships(
|
||||
// dynamic_cast<const source_file &>(*file), ostr);
|
||||
// });
|
||||
// }
|
||||
// else {
|
||||
// util::for_each_if(
|
||||
// f.relationships(),
|
||||
// [this](const auto &r) {
|
||||
// return m_model.should_include(r.type()) &&
|
||||
// util::contains(m_generated_aliases, r.destination());
|
||||
// },
|
||||
// [&f, &ostr](const auto &r) {
|
||||
// ostr << f.alias() << " "
|
||||
// << plantuml_common::to_plantuml(r.type(), r.style())
|
||||
// << " "
|
||||
// << r.destination() << '\n';
|
||||
// });
|
||||
// }
|
||||
}
|
||||
|
||||
void generator::generate(const source_file &f, std::ostream &ostr) const
|
||||
|
||||
@@ -42,7 +42,8 @@ public:
|
||||
|
||||
void operator()(const cppast::cpp_entity &file);
|
||||
|
||||
void finalize() {}
|
||||
void finalize() { }
|
||||
|
||||
private:
|
||||
clang::SourceManager &source_manager_;
|
||||
|
||||
|
||||
@@ -106,9 +106,8 @@ int main(int argc, const char *argv[])
|
||||
|
||||
std::string err{};
|
||||
|
||||
auto db =
|
||||
clang::tooling::CompilationDatabase::autoDetectFromDirectory(
|
||||
config.compilation_database_dir(), err);
|
||||
auto db = clang::tooling::CompilationDatabase::autoDetectFromDirectory(
|
||||
config.compilation_database_dir(), err);
|
||||
|
||||
if (!err.empty()) {
|
||||
LOG_ERROR("Failed to load compilation database from {}",
|
||||
|
||||
@@ -32,15 +32,16 @@ void generator::generate_relationships(
|
||||
{
|
||||
LOG_DBG("Generating relationships for package {}", p.full_name(true));
|
||||
|
||||
// const auto &uns = m_config.using_namespace();
|
||||
// const auto &uns = m_config.using_namespace();
|
||||
|
||||
// Generate this packages relationship
|
||||
if (m_model.should_include(relationship_t::kDependency)) {
|
||||
for (const auto &r : p.relationships()) {
|
||||
std::stringstream relstr;
|
||||
try {
|
||||
relstr << p.alias() << " ..> "
|
||||
//<< m_model.get_ to_alias(uns.relative(r.destination()))
|
||||
relstr << p.alias()
|
||||
<< " ..> "
|
||||
//<< m_model.get_ to_alias(uns.relative(r.destination()))
|
||||
<< '\n';
|
||||
ostr << relstr.str();
|
||||
}
|
||||
|
||||
@@ -34,13 +34,14 @@
|
||||
namespace clanguml::package_diagram::visitor {
|
||||
|
||||
class translation_unit_visitor
|
||||
: public clang::RecursiveASTVisitor<translation_unit_visitor>{
|
||||
: public clang::RecursiveASTVisitor<translation_unit_visitor> {
|
||||
public:
|
||||
translation_unit_visitor(clang::SourceManager &sm,
|
||||
clanguml::package_diagram::model::diagram &diagram,
|
||||
const clanguml::config::package_diagram &config);
|
||||
|
||||
void finalize() {}
|
||||
void finalize() { }
|
||||
|
||||
private:
|
||||
clang::SourceManager &source_manager_;
|
||||
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
#include "cx/util.h"
|
||||
#include "translation_unit_context.h"
|
||||
|
||||
|
||||
namespace clanguml::sequence_diagram::visitor {
|
||||
|
||||
translation_unit_visitor::translation_unit_visitor(clang::SourceManager &sm,
|
||||
@@ -34,7 +33,6 @@ translation_unit_visitor::translation_unit_visitor(clang::SourceManager &sm,
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
void translation_unit_visitor::process_activities(const cppast::cpp_function &e)
|
||||
{
|
||||
|
||||
@@ -33,7 +33,8 @@ public:
|
||||
clanguml::sequence_diagram::model::diagram &diagram,
|
||||
const clanguml::config::sequence_diagram &config);
|
||||
|
||||
void finalize() {}
|
||||
void finalize() { }
|
||||
|
||||
private:
|
||||
clang::SourceManager &source_manager_;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user