Fixed class visitor continuation after inner class
This commit is contained in:
@@ -186,6 +186,7 @@ static enum CXChildVisitResult class_visitor(
|
||||
|
||||
ctx->ctx->d.classes.emplace_back(std::move(c));
|
||||
});
|
||||
ret = CXChildVisit_Continue;
|
||||
break;
|
||||
case CXCursor_EnumDecl:
|
||||
if (!config.should_include(cursor.fully_qualified())) {
|
||||
|
||||
@@ -50,7 +50,11 @@ std::vector<std::string> split(std::string str, std::string delimiter)
|
||||
std::string ns_relative(
|
||||
const std::vector<std::string> &namespaces, const std::string &n)
|
||||
{
|
||||
for (const auto &ns : namespaces) {
|
||||
std::vector<std::string> namespaces_sorted{namespaces};
|
||||
|
||||
std::sort(namespaces_sorted.rbegin(), namespaces_sorted.rend());
|
||||
|
||||
for (const auto &ns : namespaces_sorted) {
|
||||
if (ns.empty())
|
||||
continue;
|
||||
|
||||
|
||||
@@ -6,9 +6,9 @@ diagrams:
|
||||
glob:
|
||||
- ../../tests/t00004/t00004.cc
|
||||
using_namespace:
|
||||
- clanguml::t00004::A::AA
|
||||
- clanguml::t00004::A
|
||||
- clanguml::t00004
|
||||
- clanguml::t00004::A
|
||||
- clanguml::t00004::A::AA
|
||||
include:
|
||||
namespaces:
|
||||
- clanguml::t00004
|
||||
|
||||
@@ -3,6 +3,8 @@ namespace t00004 {
|
||||
|
||||
class A {
|
||||
public:
|
||||
void foo() const {}
|
||||
|
||||
class AA {
|
||||
public:
|
||||
enum class Lights { Green, Yellow, Red };
|
||||
@@ -11,7 +13,7 @@ public:
|
||||
};
|
||||
};
|
||||
|
||||
void foo() const {}
|
||||
void foo2() const {}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -258,6 +258,8 @@ TEST_CASE("Test t00004", "[unit-test]")
|
||||
REQUIRE_THAT(puml, Contains("A +-- AA"));
|
||||
REQUIRE_THAT(puml, Contains("AA +-- AAA"));
|
||||
REQUIRE_THAT(puml, Contains("AA +-- Lights"));
|
||||
REQUIRE_THAT(puml, Contains("+ foo() const"));
|
||||
REQUIRE_THAT(puml, Contains("+ foo2() const"));
|
||||
|
||||
save_puml(
|
||||
"./" + config.output_directory + "/" + diagram->name + ".puml", puml);
|
||||
|
||||
Reference in New Issue
Block a user