Fixed formatting
This commit is contained in:
@@ -107,8 +107,8 @@ private:
|
|||||||
|
|
||||||
namespace std {
|
namespace std {
|
||||||
template <>
|
template <>
|
||||||
struct hash<std::reference_wrapper<
|
struct hash<
|
||||||
const clanguml::class_diagram::model::class_>> {
|
std::reference_wrapper<const clanguml::class_diagram::model::class_>> {
|
||||||
std::size_t operator()(const std::reference_wrapper<
|
std::size_t operator()(const std::reference_wrapper<
|
||||||
const clanguml::class_diagram::model::class_> &key) const
|
const clanguml::class_diagram::model::class_> &key) const
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -144,7 +144,8 @@ private:
|
|||||||
const clang::TemplateSpecializationType &template_instantiation_type);
|
const clang::TemplateSpecializationType &template_instantiation_type);
|
||||||
|
|
||||||
void process_unexposed_template_specialization_parameters(
|
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);
|
clanguml::class_diagram::model::class_ &c);
|
||||||
|
|
||||||
bool find_relationships_in_unexposed_template_params(
|
bool find_relationships_in_unexposed_template_params(
|
||||||
|
|||||||
@@ -67,7 +67,8 @@ public:
|
|||||||
return false;
|
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:
|
private:
|
||||||
std::string name_;
|
std::string name_;
|
||||||
|
|||||||
@@ -34,8 +34,6 @@ namespace clanguml::common::model {
|
|||||||
|
|
||||||
class element : public diagram_element, public source_location {
|
class element : public diagram_element, public source_location {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
||||||
element(const namespace_ &using_namespace);
|
element(const namespace_ &using_namespace);
|
||||||
|
|
||||||
virtual ~element() = default;
|
virtual ~element() = default;
|
||||||
|
|||||||
@@ -52,7 +52,8 @@ void generator::generate_relationships(
|
|||||||
// },
|
// },
|
||||||
// [&f, &ostr](const auto &r) {
|
// [&f, &ostr](const auto &r) {
|
||||||
// ostr << f.alias() << " "
|
// ostr << f.alias() << " "
|
||||||
// << plantuml_common::to_plantuml(r.type(), r.style()) << " "
|
// << plantuml_common::to_plantuml(r.type(), r.style())
|
||||||
|
// << " "
|
||||||
// << r.destination() << '\n';
|
// << r.destination() << '\n';
|
||||||
// });
|
// });
|
||||||
// }
|
// }
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ public:
|
|||||||
void operator()(const cppast::cpp_entity &file);
|
void operator()(const cppast::cpp_entity &file);
|
||||||
|
|
||||||
void finalize() { }
|
void finalize() { }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
clang::SourceManager &source_manager_;
|
clang::SourceManager &source_manager_;
|
||||||
|
|
||||||
|
|||||||
@@ -106,8 +106,7 @@ int main(int argc, const char *argv[])
|
|||||||
|
|
||||||
std::string err{};
|
std::string err{};
|
||||||
|
|
||||||
auto db =
|
auto db = clang::tooling::CompilationDatabase::autoDetectFromDirectory(
|
||||||
clang::tooling::CompilationDatabase::autoDetectFromDirectory(
|
|
||||||
config.compilation_database_dir(), err);
|
config.compilation_database_dir(), err);
|
||||||
|
|
||||||
if (!err.empty()) {
|
if (!err.empty()) {
|
||||||
|
|||||||
@@ -39,7 +39,8 @@ void generator::generate_relationships(
|
|||||||
for (const auto &r : p.relationships()) {
|
for (const auto &r : p.relationships()) {
|
||||||
std::stringstream relstr;
|
std::stringstream relstr;
|
||||||
try {
|
try {
|
||||||
relstr << p.alias() << " ..> "
|
relstr << p.alias()
|
||||||
|
<< " ..> "
|
||||||
//<< m_model.get_ to_alias(uns.relative(r.destination()))
|
//<< m_model.get_ to_alias(uns.relative(r.destination()))
|
||||||
<< '\n';
|
<< '\n';
|
||||||
ostr << relstr.str();
|
ostr << relstr.str();
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ public:
|
|||||||
const clanguml::config::package_diagram &config);
|
const clanguml::config::package_diagram &config);
|
||||||
|
|
||||||
void finalize() { }
|
void finalize() { }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
clang::SourceManager &source_manager_;
|
clang::SourceManager &source_manager_;
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,6 @@
|
|||||||
#include "cx/util.h"
|
#include "cx/util.h"
|
||||||
#include "translation_unit_context.h"
|
#include "translation_unit_context.h"
|
||||||
|
|
||||||
|
|
||||||
namespace clanguml::sequence_diagram::visitor {
|
namespace clanguml::sequence_diagram::visitor {
|
||||||
|
|
||||||
translation_unit_visitor::translation_unit_visitor(clang::SourceManager &sm,
|
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)
|
void translation_unit_visitor::process_activities(const cppast::cpp_function &e)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ public:
|
|||||||
const clanguml::config::sequence_diagram &config);
|
const clanguml::config::sequence_diagram &config);
|
||||||
|
|
||||||
void finalize() { }
|
void finalize() { }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
clang::SourceManager &source_manager_;
|
clang::SourceManager &source_manager_;
|
||||||
|
|
||||||
|
|||||||
@@ -84,9 +84,11 @@ TEST_CASE("t00014", "[test-case][class]")
|
|||||||
REQUIRE_THAT(puml,
|
REQUIRE_THAT(puml,
|
||||||
IsInstantiation(_A("A<T,std::string>"), _A("A<bool,std::string>")));
|
IsInstantiation(_A("A<T,std::string>"), _A("A<bool,std::string>")));
|
||||||
// REQUIRE_THAT(puml,
|
// REQUIRE_THAT(puml,
|
||||||
// IsInstantiation(_A("A<T,std::string>"), _A("A<char,std::string>")));
|
// IsInstantiation(_A("A<T,std::string>"),
|
||||||
|
// _A("A<char,std::string>")));
|
||||||
// REQUIRE_THAT(puml,
|
// REQUIRE_THAT(puml,
|
||||||
// IsInstantiation(_A("A<T,std::string>"), _A("A<wchar_t,std::string>")));
|
// IsInstantiation(_A("A<T,std::string>"),
|
||||||
|
// _A("A<wchar_t,std::string>")));
|
||||||
|
|
||||||
REQUIRE_THAT(puml,
|
REQUIRE_THAT(puml,
|
||||||
IsInstantiation(_A("A<T,std::unique_ptr<std::string>>"),
|
IsInstantiation(_A("A<T,std::unique_ptr<std::string>>"),
|
||||||
@@ -109,7 +111,8 @@ TEST_CASE("t00014", "[test-case][class]")
|
|||||||
IsAggregation(_A("R"), _A("A<float,std::unique_ptr<std::string>>"),
|
IsAggregation(_A("R"), _A("A<float,std::unique_ptr<std::string>>"),
|
||||||
"-floatstring"));
|
"-floatstring"));
|
||||||
// REQUIRE_THAT(puml, IsDependency(_A("R"), _A("A<char,std::string>")));
|
// REQUIRE_THAT(puml, IsDependency(_A("R"), _A("A<char,std::string>")));
|
||||||
// REQUIRE_THAT(puml, IsDependency(_A("R"), _A("A<wchar_t,std::string>")));
|
// REQUIRE_THAT(puml, IsDependency(_A("R"),
|
||||||
|
// _A("A<wchar_t,std::string>")));
|
||||||
|
|
||||||
save_puml(
|
save_puml(
|
||||||
"./" + config.output_directory() + "/" + diagram->name + ".puml", puml);
|
"./" + config.output_directory() + "/" + diagram->name + ".puml", puml);
|
||||||
|
|||||||
@@ -46,8 +46,8 @@ TEST_CASE("t00016", "[test-case][class]")
|
|||||||
puml, IsInstantiation(_A("is_numeric<>"), _A("is_numeric<bool>")));
|
puml, IsInstantiation(_A("is_numeric<>"), _A("is_numeric<bool>")));
|
||||||
REQUIRE_THAT(
|
REQUIRE_THAT(
|
||||||
puml, IsInstantiation(_A("is_numeric<>"), _A("is_numeric<char>")));
|
puml, IsInstantiation(_A("is_numeric<>"), _A("is_numeric<char>")));
|
||||||
REQUIRE_THAT(puml,
|
REQUIRE_THAT(
|
||||||
IsInstantiation(_A("is_numeric<>"), _A("is_numeric<float>")));
|
puml, IsInstantiation(_A("is_numeric<>"), _A("is_numeric<float>")));
|
||||||
|
|
||||||
save_puml(
|
save_puml(
|
||||||
"./" + config.output_directory() + "/" + diagram->name + ".puml", puml);
|
"./" + config.output_directory() + "/" + diagram->name + ".puml", puml);
|
||||||
|
|||||||
@@ -48,7 +48,8 @@ TEST_CASE("t00017", "[test-case][class]")
|
|||||||
|
|
||||||
REQUIRE_THAT(puml, (IsField<Private>("some_int", "int")));
|
REQUIRE_THAT(puml, (IsField<Private>("some_int", "int")));
|
||||||
REQUIRE_THAT(puml, (IsField<Private>("some_int_pointer", "int *")));
|
REQUIRE_THAT(puml, (IsField<Private>("some_int_pointer", "int *")));
|
||||||
REQUIRE_THAT(puml, (IsField<Private>("some_int_pointer_pointer", "int **")));
|
REQUIRE_THAT(
|
||||||
|
puml, (IsField<Private>("some_int_pointer_pointer", "int **")));
|
||||||
|
|
||||||
// Relationship members should not be rendered as part of this testcase
|
// Relationship members should not be rendered as part of this testcase
|
||||||
REQUIRE_THAT(puml, !(IsField<Private>("a", _A("A"))));
|
REQUIRE_THAT(puml, !(IsField<Private>("a", _A("A"))));
|
||||||
|
|||||||
@@ -47,10 +47,8 @@ TEST_CASE("t00025", "[test-case][class]")
|
|||||||
puml, !IsAggregation(_A("ProxyHolder"), _A("Target1"), "+proxy1"));
|
puml, !IsAggregation(_A("ProxyHolder"), _A("Target1"), "+proxy1"));
|
||||||
REQUIRE_THAT(
|
REQUIRE_THAT(
|
||||||
puml, !IsAggregation(_A("ProxyHolder"), _A("Target2"), "+proxy2"));
|
puml, !IsAggregation(_A("ProxyHolder"), _A("Target2"), "+proxy2"));
|
||||||
REQUIRE_THAT(
|
REQUIRE_THAT(puml, IsDependency(_A("Proxy<Target1>"), _A("Target1")));
|
||||||
puml, IsDependency(_A("Proxy<Target1>"), _A("Target1")));
|
REQUIRE_THAT(puml, IsDependency(_A("Proxy<Target2>"), _A("Target2")));
|
||||||
REQUIRE_THAT(
|
|
||||||
puml, IsDependency(_A("Proxy<Target2>"), _A("Target2")));
|
|
||||||
|
|
||||||
save_puml(
|
save_puml(
|
||||||
"./" + config.output_directory() + "/" + diagram->name + ".puml", puml);
|
"./" + config.output_directory() + "/" + diagram->name + ".puml", puml);
|
||||||
|
|||||||
@@ -4,15 +4,20 @@
|
|||||||
namespace clanguml {
|
namespace clanguml {
|
||||||
namespace t00030 {
|
namespace t00030 {
|
||||||
|
|
||||||
class A { };
|
class A {
|
||||||
|
};
|
||||||
|
|
||||||
class B { };
|
class B {
|
||||||
|
};
|
||||||
|
|
||||||
class C { };
|
class C {
|
||||||
|
};
|
||||||
|
|
||||||
class D { };
|
class D {
|
||||||
|
};
|
||||||
|
|
||||||
class E { };
|
class E {
|
||||||
|
};
|
||||||
|
|
||||||
struct R {
|
struct R {
|
||||||
/// @uml{association[]}
|
/// @uml{association[]}
|
||||||
|
|||||||
@@ -25,7 +25,8 @@ namespace ns2 {
|
|||||||
namespace ns22 {
|
namespace ns22 {
|
||||||
|
|
||||||
// TODO: Fix for incomplete struct C declaration "struct C;"
|
// TODO: Fix for incomplete struct C declaration "struct C;"
|
||||||
struct C {};
|
struct C {
|
||||||
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,7 +32,8 @@ struct key_t {
|
|||||||
std::string key;
|
std::string key;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename T> struct map {};
|
template <typename T> struct map {
|
||||||
|
};
|
||||||
|
|
||||||
using namespace thirdparty::ns1;
|
using namespace thirdparty::ns1;
|
||||||
|
|
||||||
|
|||||||
@@ -37,8 +37,8 @@
|
|||||||
|
|
||||||
#include "catch.h"
|
#include "catch.h"
|
||||||
|
|
||||||
#include <clang/Tooling/Tooling.h>
|
|
||||||
#include <clang/Tooling/CompilationDatabase.h>
|
#include <clang/Tooling/CompilationDatabase.h>
|
||||||
|
#include <clang/Tooling/Tooling.h>
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <complex>
|
#include <complex>
|
||||||
@@ -52,7 +52,8 @@ using Catch::Matchers::StartsWith;
|
|||||||
using Catch::Matchers::VectorContains;
|
using Catch::Matchers::VectorContains;
|
||||||
using namespace clanguml::util;
|
using namespace clanguml::util;
|
||||||
|
|
||||||
std::pair<clanguml::config::config, std::unique_ptr<clang::tooling::CompilationDatabase>>
|
std::pair<clanguml::config::config,
|
||||||
|
std::unique_ptr<clang::tooling::CompilationDatabase>>
|
||||||
load_config(const std::string &test_name);
|
load_config(const std::string &test_name);
|
||||||
|
|
||||||
std::string generate_sequence_puml(
|
std::string generate_sequence_puml(
|
||||||
|
|||||||
Reference in New Issue
Block a user