Files
clang-uml/docs/test_cases/t30007.md
2024-06-17 22:02:29 +02:00

3.0 KiB

t30007 - Package diagram layout hints test case

Config

diagrams:
  t30007_package:
    type: package
    glob:
      - t30007.cc
    include:
      namespaces:
        - clanguml::t30007
    using_namespace: clanguml::t30007
    layout:
      C:
        - up: 'A::AA'
        - left: B
    plantuml:
      before:
        - "' t30007 test package diagram"

Source code

File tests/t30007/t30007.cc

namespace clanguml {
namespace t30007 {

namespace B {
struct BB { };
}

/// \uml{note[top] Compare layout with t30006.}
namespace A {
namespace AA {
struct A1 {
    B::BB *b;
};
}
}

namespace C {
struct CC { };
}

/// \uml{note[bottom] Bottom A note.}
namespace A {
namespace AA {
struct A2 {
    C::CC *c;
};
}
}

}
}

Generated PlantUML diagrams

t30007_package

Generated Mermaid diagrams

t30007_package

Generated JSON models

{
  "diagram_type": "package",
  "elements": [
    {
      "display_name": "B",
      "id": "14821633768042844406",
      "is_deprecated": false,
      "name": "B",
      "namespace": "clanguml::t30007",
      "source_location": {
        "column": 11,
        "file": "t30007.cc",
        "line": 4,
        "translation_unit": "t30007.cc"
      },
      "type": "namespace"
    },
    {
      "comment": {
        "formatted": "\\uml{note[top] Compare layout with t30006.}",
        "raw": "/// \\uml{note[top] Compare layout with t30006.}"
      },
      "display_name": "A",
      "elements": [
        {
          "display_name": "AA",
          "id": "2861780046545905366",
          "is_deprecated": false,
          "name": "AA",
          "namespace": "clanguml::t30007::A",
          "source_location": {
            "column": 11,
            "file": "t30007.cc",
            "line": 10,
            "translation_unit": "t30007.cc"
          },
          "type": "namespace"
        }
      ],
      "id": "6966996923110930767",
      "is_deprecated": false,
      "name": "A",
      "namespace": "clanguml::t30007",
      "source_location": {
        "column": 11,
        "file": "t30007.cc",
        "line": 9,
        "translation_unit": "t30007.cc"
      },
      "type": "namespace"
    },
    {
      "display_name": "C",
      "id": "7502332303098546906",
      "is_deprecated": false,
      "name": "C",
      "namespace": "clanguml::t30007",
      "source_location": {
        "column": 11,
        "file": "t30007.cc",
        "line": 17,
        "translation_unit": "t30007.cc"
      },
      "type": "namespace"
    }
  ],
  "name": "t30007_package",
  "package_type": "namespace",
  "relationships": [
    {
      "destination": "14821633768042844406",
      "source": "2861780046545905366",
      "type": "dependency"
    },
    {
      "destination": "7502332303098546906",
      "source": "2861780046545905366",
      "type": "dependency"
    }
  ],
  "using_namespace": "clanguml::t30007"
}