Skip friends outside of included scope
This commit is contained in:
@@ -215,8 +215,15 @@ static enum CXChildVisitResult friend_class_visitor(
|
|||||||
enum CXChildVisitResult ret = CXChildVisit_Break;
|
enum CXChildVisitResult ret = CXChildVisit_Break;
|
||||||
switch (cursor.kind()) {
|
switch (cursor.kind()) {
|
||||||
case CXCursor_TypeRef: {
|
case CXCursor_TypeRef: {
|
||||||
|
if (!ctx->ctx->config.should_include(
|
||||||
|
cursor.referenced().fully_qualified())) {
|
||||||
|
ret = CXChildVisit_Continue;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
spdlog::info("Adding friend declaration: {}, {}", cursor,
|
spdlog::info("Adding friend declaration: {}, {}", cursor,
|
||||||
cursor.referenced());
|
cursor.referenced());
|
||||||
|
|
||||||
class_relationship r;
|
class_relationship r;
|
||||||
r.type = relationship_t::kFriendship;
|
r.type = relationship_t::kFriendship;
|
||||||
r.label = "<<friend>>";
|
r.label = "<<friend>>";
|
||||||
|
|||||||
@@ -1,3 +1,8 @@
|
|||||||
|
namespace external {
|
||||||
|
class C {
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
namespace clanguml {
|
namespace clanguml {
|
||||||
namespace t00011 {
|
namespace t00011 {
|
||||||
|
|
||||||
@@ -7,6 +12,7 @@ class A {
|
|||||||
private:
|
private:
|
||||||
void foo() {}
|
void foo() {}
|
||||||
friend class B;
|
friend class B;
|
||||||
|
friend class external::C;
|
||||||
};
|
};
|
||||||
|
|
||||||
class B {
|
class B {
|
||||||
|
|||||||
Reference in New Issue
Block a user