Fixed formatting
This commit is contained in:
@@ -18,10 +18,10 @@
|
||||
#pragma once
|
||||
|
||||
#include "class_diagram/model/class.h"
|
||||
#include "common/model/relationship.h"
|
||||
#include "class_diagram/model/diagram.h"
|
||||
#include "class_diagram/model/enum.h"
|
||||
#include "class_diagram/visitor/translation_unit_visitor.h"
|
||||
#include "common/model/relationship.h"
|
||||
#include "config/config.h"
|
||||
#include "cx/compilation_database.h"
|
||||
#include "util/util.h"
|
||||
|
||||
@@ -36,20 +36,19 @@
|
||||
|
||||
namespace clanguml::class_diagram::visitor {
|
||||
|
||||
using clanguml::common::model::access_t;
|
||||
using clanguml::class_diagram::model::class_;
|
||||
using clanguml::class_diagram::model::class_member;
|
||||
using clanguml::class_diagram::model::class_method;
|
||||
using clanguml::class_diagram::model::class_parent;
|
||||
using clanguml::class_diagram::model::class_template;
|
||||
using clanguml::class_diagram::model::class_template;
|
||||
using clanguml::class_diagram::model::diagram;
|
||||
using clanguml::class_diagram::model::enum_;
|
||||
using clanguml::class_diagram::model::method_parameter;
|
||||
using clanguml::class_diagram::model::type_alias;
|
||||
using clanguml::common::model::access_t;
|
||||
using clanguml::common::model::relationship;
|
||||
using clanguml::common::model::relationship_t;
|
||||
using clanguml::common::model::scope_t;
|
||||
using clanguml::class_diagram::model::type_alias;
|
||||
using clanguml::common::model::relationship;
|
||||
|
||||
namespace detail {
|
||||
scope_t cpp_access_specifier_to_scope(
|
||||
@@ -569,9 +568,8 @@ bool translation_unit_visitor::process_field_with_template_instantiation(
|
||||
|
||||
if (ctx.config().should_include(tinst.name())) {
|
||||
LOG_DBG("Adding field instantiation relationship {} {} {} : {}",
|
||||
rr.destination(),
|
||||
clanguml::common::model::to_string(rr.type()), c.full_name(),
|
||||
rr.label());
|
||||
rr.destination(), clanguml::common::model::to_string(rr.type()),
|
||||
c.full_name(), rr.label());
|
||||
|
||||
c.add_relationship(std::move(rr));
|
||||
|
||||
@@ -633,8 +631,7 @@ void translation_unit_visitor::process_field(
|
||||
|
||||
for (const auto &[type, relationship_type] : relationships) {
|
||||
if (relationship_type != relationship_t::kNone) {
|
||||
relationship r{
|
||||
relationship_type, type, m.scope(), m.name()};
|
||||
relationship r{relationship_type, type, m.scope(), m.name()};
|
||||
r.set_style(m.style_spec());
|
||||
|
||||
auto [decorator_rtype, decorator_rmult] = m.get_relationship();
|
||||
@@ -649,8 +646,8 @@ void translation_unit_visitor::process_field(
|
||||
|
||||
LOG_DBG("Adding field relationship {} {} {} : {}",
|
||||
r.destination(),
|
||||
clanguml::common::model::to_string(r.type()),
|
||||
c.full_name(), r.label());
|
||||
clanguml::common::model::to_string(r.type()), c.full_name(),
|
||||
r.label());
|
||||
|
||||
c.add_relationship(std::move(r));
|
||||
}
|
||||
@@ -879,8 +876,8 @@ void translation_unit_visitor::process_function_parameter(
|
||||
|
||||
LOG_DBG("Adding field relationship {} {} {} : {}",
|
||||
r.destination(),
|
||||
clanguml::common::model::to_string(r.type()),
|
||||
c.full_name(), r.label());
|
||||
clanguml::common::model::to_string(r.type()), c.full_name(),
|
||||
r.label());
|
||||
|
||||
c.add_relationship(std::move(r));
|
||||
}
|
||||
@@ -948,8 +945,7 @@ void translation_unit_visitor::process_function_parameter(
|
||||
"{} {} {} "
|
||||
": {}",
|
||||
rr.destination(),
|
||||
clanguml::common::model::to_string(
|
||||
rr.type()),
|
||||
clanguml::common::model::to_string(rr.type()),
|
||||
c.full_name(), rr.label());
|
||||
c.add_relationship(std::move(rr));
|
||||
}
|
||||
@@ -964,8 +960,7 @@ void translation_unit_visitor::process_function_parameter(
|
||||
LOG_DBG("Adding field dependency relationship {} {} {} "
|
||||
": {}",
|
||||
rr.destination(),
|
||||
clanguml::common::model::to_string(
|
||||
rr.type()),
|
||||
clanguml::common::model::to_string(rr.type()),
|
||||
c.full_name(), rr.label());
|
||||
|
||||
c.add_relationship(std::move(rr));
|
||||
@@ -1393,8 +1388,7 @@ class_ translation_unit_visitor::build_template_instantiation(
|
||||
}
|
||||
else if (targ.type().value().kind() ==
|
||||
cppast::cpp_type_kind::user_defined_t) {
|
||||
relationship tinst_dependency{
|
||||
relationship_t::kDependency,
|
||||
relationship tinst_dependency{relationship_t::kDependency,
|
||||
cx::util::full_name(
|
||||
cppast::remove_cv(
|
||||
cx::util::unreferenced(targ.type().value())),
|
||||
|
||||
@@ -38,7 +38,8 @@ bool decorated_element::skip_relationship() const
|
||||
return false;
|
||||
}
|
||||
|
||||
std::pair<relationship_t, std::string> decorated_element::get_relationship() const
|
||||
std::pair<relationship_t, std::string>
|
||||
decorated_element::get_relationship() const
|
||||
{
|
||||
for (auto &d : decorators_)
|
||||
if (std::dynamic_pointer_cast<decorators::association>(d))
|
||||
|
||||
@@ -56,10 +56,7 @@ const std::vector<std::string> &element::using_namespaces() const
|
||||
return using_namespaces_;
|
||||
}
|
||||
|
||||
std::vector<relationship> &element::relationships()
|
||||
{
|
||||
return relationships_;
|
||||
}
|
||||
std::vector<relationship> &element::relationships() { return relationships_; }
|
||||
|
||||
const std::vector<relationship> &element::relationships() const
|
||||
{
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "relationship.h"
|
||||
#include "decorated_element.h"
|
||||
#include "relationship.h"
|
||||
|
||||
|
||||
@@ -48,8 +48,8 @@ std::string to_string(relationship_t r)
|
||||
}
|
||||
}
|
||||
|
||||
relationship::relationship(relationship_t type,
|
||||
const std::string &destination, scope_t scope, const std::string &label,
|
||||
relationship::relationship(relationship_t type, const std::string &destination,
|
||||
scope_t scope, const std::string &label,
|
||||
const std::string &multiplicity_source,
|
||||
const std::string &multiplicity_destination)
|
||||
: type_{type}
|
||||
@@ -61,10 +61,7 @@ relationship::relationship(relationship_t type,
|
||||
{
|
||||
}
|
||||
|
||||
void relationship::set_type(relationship_t type) noexcept
|
||||
{
|
||||
type_ = type;
|
||||
}
|
||||
void relationship::set_type(relationship_t type) noexcept { type_ = type; }
|
||||
|
||||
relationship_t relationship::type() const noexcept { return type_; }
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace clanguml::common::model {
|
||||
std::string to_string(relationship_t r);
|
||||
|
||||
class relationship : public common::model::decorated_element,
|
||||
public common::model::stylable_element {
|
||||
public common::model::stylable_element {
|
||||
public:
|
||||
relationship(relationship_t type, const std::string &destination,
|
||||
scope_t scope = scope_t::kNone, const std::string &label = "",
|
||||
@@ -55,8 +55,7 @@ public:
|
||||
void set_scope(scope_t scope) noexcept;
|
||||
scope_t scope() const noexcept;
|
||||
|
||||
friend bool operator==(
|
||||
const relationship &l, const relationship &r);
|
||||
friend bool operator==(const relationship &l, const relationship &r);
|
||||
|
||||
private:
|
||||
relationship_t type_{relationship_t::kAssociation};
|
||||
|
||||
@@ -89,8 +89,7 @@ bool diagram::should_include(const std::string &name_) const
|
||||
return false;
|
||||
}
|
||||
|
||||
bool diagram::should_include(
|
||||
const clanguml::common::model::scope_t scope) const
|
||||
bool diagram::should_include(const clanguml::common::model::scope_t scope) const
|
||||
{
|
||||
for (const auto &s : exclude.scopes) {
|
||||
if (s == scope)
|
||||
|
||||
@@ -17,12 +17,12 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "package_diagram/model/package.h"
|
||||
#include "package_diagram/visitor/translation_unit_visitor.h"
|
||||
#include "common/model/relationship.h"
|
||||
#include "config/config.h"
|
||||
#include "cx/compilation_database.h"
|
||||
#include "package_diagram/model/diagram.h"
|
||||
#include "package_diagram/model/package.h"
|
||||
#include "package_diagram/visitor/translation_unit_visitor.h"
|
||||
#include "util/util.h"
|
||||
|
||||
#include <cppast/cpp_entity_index.hpp>
|
||||
|
||||
@@ -34,7 +34,7 @@ std::string package::full_name(bool relative) const
|
||||
auto ns = using_namespaces();
|
||||
|
||||
if (relative && (fn.size() >= ns.size())) {
|
||||
if(starts_with(fn, ns))
|
||||
if (starts_with(fn, ns))
|
||||
fn = std::vector<std::string>(fn.begin() + ns.size(), fn.end());
|
||||
}
|
||||
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "util/util.h"
|
||||
#include "common/model/element.h"
|
||||
#include "common/model/stylable_element.h"
|
||||
#include "util/util.h"
|
||||
|
||||
#include <spdlog/spdlog.h>
|
||||
#include <type_safe/optional_ref.hpp>
|
||||
|
||||
@@ -17,10 +17,10 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "package_diagram/model/diagram.h"
|
||||
#include "package_diagram/visitor/translation_unit_context.h"
|
||||
#include "config/config.h"
|
||||
#include "cx/cursor.h"
|
||||
#include "package_diagram/model/diagram.h"
|
||||
#include "package_diagram/visitor/translation_unit_context.h"
|
||||
|
||||
#include <clang-c/CXCompilationDatabase.h>
|
||||
#include <clang-c/Index.h>
|
||||
|
||||
@@ -139,7 +139,7 @@ template <typename T> void append(std::vector<T> &l, const std::vector<T> &r)
|
||||
template <typename T>
|
||||
bool starts_with(const std::vector<T> &col, const std::vector<T> &prefix)
|
||||
{
|
||||
if(prefix.size() > col.size())
|
||||
if (prefix.size() > col.size())
|
||||
return false;
|
||||
|
||||
return std::vector<std::string>(prefix.begin(), prefix.end()) ==
|
||||
|
||||
27335
tests/catch.h
27335
tests/catch.h
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user