# t00065 - Class diagram with packages from directory structure
## Config
```yaml
diagrams:
  t00065_class:
    type: class
    glob:
      - t00065.cc
    generate_packages: true
    package_type: directory
    include:
      namespaces:
        - clanguml::t00065
    using_namespace: clanguml::t00065
```
## Source code
File `tests/t00065/t00065.cc`
```cpp
#include "module1/module1.h"
#include "module2/module2.h"

namespace clanguml {
namespace t00065 {
struct R {
    A *a;
    C<B> c;
    D<B> d;
};
}
}
```
File `tests/t00065/module2/module2.h`
```cpp
#pragma once

#include "concepts/concepts.h"

namespace clanguml {
namespace t00065 {
struct B {
    B() = default;
    void b() { }
};

template <typename T> struct C {
    T *t;
};

template <bconcept T> struct D {
    T t;
    C<int> c;
};

}
}
```
File `tests/t00065/module2/concepts/concepts.h`
```cpp
#pragma once

namespace clanguml {
namespace t00065 {

template <typename T>
concept bconcept = requires(T t) {
                       T{};
                       t.b();
                   };

}
}
```
File `tests/t00065/module1/module1.h`
```cpp
#include "submodule1a/submodule1a.h"

#pragma once

namespace clanguml {
namespace t00065 {

enum class ABC { a, b, c };

enum XYZ { x, y, z };

struct A {
    ABC abc;
    XYZ xyz;
    detail::AImpl *pimpl;
};
}
}
```
File `tests/t00065/module1/submodule1a/submodule1a.h`
```cpp
#pragma once

namespace clanguml {
namespace t00065 {
namespace detail {
struct AImpl { };
}
}
}
```
## Generated PlantUML diagrams
![t00065_class](./t00065_class.svg "Class diagram with packages from directory structure")
## Generated Mermaid diagrams
![t00065_class](./t00065_class_mermaid.svg "Class diagram with packages from directory structure")
## Generated JSON models
```json
{
  "diagram_type": "class",
  "elements": [
    {
      "display_name": "module1",
      "elements": [
        {
          "display_name": "submodule1a",
          "elements": [
            {
              "bases": [],
              "display_name": "detail::AImpl",
              "id": "674757414308736755",
              "is_abstract": false,
              "is_nested": false,
              "is_struct": true,
              "is_template": false,
              "is_union": false,
              "members": [],
              "methods": [],
              "name": "AImpl",
              "namespace": "clanguml::t00065::detail",
              "source_location": {
                "column": 8,
                "file": "module1/submodule1a/submodule1a.h",
                "line": 6,
                "translation_unit": "t00065.cc"
              },
              "template_parameters": [],
              "type": "class"
            }
          ],
          "name": "submodule1a",
          "type": "directory"
        },
        {
          "constants": [
            "a",
            "b",
            "c"
          ],
          "display_name": "ABC",
          "id": "2145362985538918973",
          "is_nested": false,
          "name": "ABC",
          "namespace": "clanguml::t00065",
          "source_location": {
            "column": 12,
            "file": "module1/module1.h",
            "line": 8,
            "translation_unit": "t00065.cc"
          },
          "type": "enum"
        },
        {
          "constants": [
            "x",
            "y",
            "z"
          ],
          "display_name": "XYZ",
          "id": "1435940218810141944",
          "is_nested": false,
          "name": "XYZ",
          "namespace": "clanguml::t00065",
          "source_location": {
            "column": 6,
            "file": "module1/module1.h",
            "line": 10,
            "translation_unit": "t00065.cc"
          },
          "type": "enum"
        },
        {
          "bases": [],
          "display_name": "A",
          "id": "1178194542408300737",
          "is_abstract": false,
          "is_nested": false,
          "is_struct": true,
          "is_template": false,
          "is_union": false,
          "members": [
            {
              "access": "public",
              "is_static": false,
              "name": "abc",
              "source_location": {
                "column": 9,
                "file": "module1/module1.h",
                "line": 13,
                "translation_unit": "t00065.cc"
              },
              "type": "ABC"
            },
            {
              "access": "public",
              "is_static": false,
              "name": "xyz",
              "source_location": {
                "column": 9,
                "file": "module1/module1.h",
                "line": 14,
                "translation_unit": "t00065.cc"
              },
              "type": "XYZ"
            },
            {
              "access": "public",
              "is_static": false,
              "name": "pimpl",
              "source_location": {
                "column": 20,
                "file": "module1/module1.h",
                "line": 15,
                "translation_unit": "t00065.cc"
              },
              "type": "detail::AImpl *"
            }
          ],
          "methods": [],
          "name": "A",
          "namespace": "clanguml::t00065",
          "source_location": {
            "column": 8,
            "file": "module1/module1.h",
            "line": 12,
            "translation_unit": "t00065.cc"
          },
          "template_parameters": [],
          "type": "class"
        }
      ],
      "name": "module1",
      "type": "directory"
    },
    {
      "display_name": "module2",
      "elements": [
        {
          "display_name": "concepts",
          "elements": [
            {
              "display_name": "bconcept<T>",
              "id": "1325475407133721370",
              "name": "bconcept",
              "namespace": "clanguml::t00065",
              "parameters": [
                {
                  "name": "clanguml::t00065::t",
                  "type": "T"
                }
              ],
              "source_location": {
                "column": 9,
                "file": "module2/concepts/concepts.h",
                "line": 7,
                "translation_unit": "t00065.cc"
              },
              "statements": [
                "T{}",
                "t.b()"
              ],
              "type": "concept"
            }
          ],
          "name": "concepts",
          "type": "directory"
        },
        {
          "bases": [],
          "display_name": "B",
          "id": "1651810571114530033",
          "is_abstract": false,
          "is_nested": false,
          "is_struct": true,
          "is_template": false,
          "is_union": false,
          "members": [],
          "methods": [
            {
              "access": "public",
              "is_const": false,
              "is_consteval": false,
              "is_constexpr": false,
              "is_constructor": true,
              "is_copy_assignment": false,
              "is_coroutine": false,
              "is_defaulted": true,
              "is_deleted": false,
              "is_move_assignment": false,
              "is_noexcept": false,
              "is_operator": false,
              "is_pure_virtual": false,
              "is_static": false,
              "is_virtual": false,
              "name": "B",
              "parameters": [],
              "source_location": {
                "column": 5,
                "file": "module2/module2.h",
                "line": 8,
                "translation_unit": "t00065.cc"
              },
              "type": "void"
            },
            {
              "access": "public",
              "is_const": false,
              "is_consteval": false,
              "is_constexpr": false,
              "is_constructor": false,
              "is_copy_assignment": false,
              "is_coroutine": false,
              "is_defaulted": false,
              "is_deleted": false,
              "is_move_assignment": false,
              "is_noexcept": false,
              "is_operator": false,
              "is_pure_virtual": false,
              "is_static": false,
              "is_virtual": false,
              "name": "b",
              "parameters": [],
              "source_location": {
                "column": 10,
                "file": "module2/module2.h",
                "line": 9,
                "translation_unit": "t00065.cc"
              },
              "type": "void"
            }
          ],
          "name": "B",
          "namespace": "clanguml::t00065",
          "source_location": {
            "column": 8,
            "file": "module2/module2.h",
            "line": 7,
            "translation_unit": "t00065.cc"
          },
          "template_parameters": [],
          "type": "class"
        },
        {
          "bases": [],
          "display_name": "C<T>",
          "id": "1157378014768957235",
          "is_abstract": false,
          "is_nested": false,
          "is_struct": true,
          "is_template": true,
          "is_union": false,
          "members": [
            {
              "access": "public",
              "is_static": false,
              "name": "t",
              "source_location": {
                "column": 8,
                "file": "module2/module2.h",
                "line": 13,
                "translation_unit": "t00065.cc"
              },
              "type": "T *"
            }
          ],
          "methods": [],
          "name": "C",
          "namespace": "clanguml::t00065",
          "source_location": {
            "column": 30,
            "file": "module2/module2.h",
            "line": 12,
            "translation_unit": "t00065.cc"
          },
          "template_parameters": [
            {
              "is_variadic": false,
              "kind": "template_type",
              "name": "T",
              "template_parameters": []
            }
          ],
          "type": "class"
        },
        {
          "bases": [],
          "display_name": "C<int>",
          "id": "580575003920044707",
          "is_abstract": false,
          "is_nested": false,
          "is_struct": false,
          "is_template": true,
          "is_union": false,
          "members": [],
          "methods": [],
          "name": "C",
          "namespace": "clanguml::t00065",
          "source_location": {
            "column": 30,
            "file": "module2/module2.h",
            "line": 12,
            "translation_unit": "t00065.cc"
          },
          "template_parameters": [
            {
              "is_variadic": false,
              "kind": "argument",
              "template_parameters": [],
              "type": "int"
            }
          ],
          "type": "class"
        },
        {
          "bases": [],
          "display_name": "D<bconcept T>",
          "id": "1719752929087851944",
          "is_abstract": false,
          "is_nested": false,
          "is_struct": true,
          "is_template": true,
          "is_union": false,
          "members": [
            {
              "access": "public",
              "is_static": false,
              "name": "t",
              "source_location": {
                "column": 7,
                "file": "module2/module2.h",
                "line": 17,
                "translation_unit": "t00065.cc"
              },
              "type": "T"
            },
            {
              "access": "public",
              "is_static": false,
              "name": "c",
              "source_location": {
                "column": 12,
                "file": "module2/module2.h",
                "line": 18,
                "translation_unit": "t00065.cc"
              },
              "type": "C<int>"
            }
          ],
          "methods": [],
          "name": "D",
          "namespace": "clanguml::t00065",
          "source_location": {
            "column": 30,
            "file": "module2/module2.h",
            "line": 16,
            "translation_unit": "t00065.cc"
          },
          "template_parameters": [
            {
              "is_variadic": false,
              "kind": "template_type",
              "name": "T",
              "template_parameters": []
            }
          ],
          "type": "class"
        },
        {
          "bases": [],
          "display_name": "C<B>",
          "id": "1373403346245688670",
          "is_abstract": false,
          "is_nested": false,
          "is_struct": false,
          "is_template": true,
          "is_union": false,
          "members": [],
          "methods": [],
          "name": "C",
          "namespace": "clanguml::t00065",
          "source_location": {
            "column": 30,
            "file": "module2/module2.h",
            "line": 12,
            "translation_unit": "t00065.cc"
          },
          "template_parameters": [
            {
              "is_variadic": false,
              "kind": "argument",
              "template_parameters": [],
              "type": "clanguml::t00065::B"
            }
          ],
          "type": "class"
        },
        {
          "bases": [],
          "display_name": "D<B>",
          "id": "2024276012622729482",
          "is_abstract": false,
          "is_nested": false,
          "is_struct": false,
          "is_template": true,
          "is_union": false,
          "members": [],
          "methods": [],
          "name": "D",
          "namespace": "clanguml::t00065",
          "source_location": {
            "column": 30,
            "file": "module2/module2.h",
            "line": 16,
            "translation_unit": "t00065.cc"
          },
          "template_parameters": [
            {
              "is_variadic": false,
              "kind": "argument",
              "template_parameters": [],
              "type": "clanguml::t00065::B"
            }
          ],
          "type": "class"
        }
      ],
      "name": "module2",
      "type": "directory"
    },
    {
      "bases": [],
      "display_name": "R",
      "id": "1082111961413727438",
      "is_abstract": false,
      "is_nested": false,
      "is_struct": true,
      "is_template": false,
      "is_union": false,
      "members": [
        {
          "access": "public",
          "is_static": false,
          "name": "a",
          "source_location": {
            "column": 8,
            "file": "t00065.cc",
            "line": 7,
            "translation_unit": "t00065.cc"
          },
          "type": "A *"
        },
        {
          "access": "public",
          "is_static": false,
          "name": "c",
          "source_location": {
            "column": 10,
            "file": "t00065.cc",
            "line": 8,
            "translation_unit": "t00065.cc"
          },
          "type": "C<B>"
        },
        {
          "access": "public",
          "is_static": false,
          "name": "d",
          "source_location": {
            "column": 10,
            "file": "t00065.cc",
            "line": 9,
            "translation_unit": "t00065.cc"
          },
          "type": "D<B>"
        }
      ],
      "methods": [],
      "name": "R",
      "namespace": "clanguml::t00065",
      "source_location": {
        "column": 8,
        "file": "t00065.cc",
        "line": 6,
        "translation_unit": "t00065.cc"
      },
      "template_parameters": [],
      "type": "class"
    }
  ],
  "name": "t00065_class",
  "package_type": "directory",
  "relationships": [
    {
      "access": "public",
      "destination": "2145362985538918973",
      "label": "abc",
      "source": "1178194542408300737",
      "type": "aggregation"
    },
    {
      "access": "public",
      "destination": "1435940218810141944",
      "label": "xyz",
      "source": "1178194542408300737",
      "type": "aggregation"
    },
    {
      "access": "public",
      "destination": "674757414308736755",
      "label": "pimpl",
      "source": "1178194542408300737",
      "type": "association"
    },
    {
      "access": "public",
      "destination": "1157378014768957235",
      "source": "580575003920044707",
      "type": "instantiation"
    },
    {
      "destination": "1325475407133721370",
      "label": "T",
      "source": "1719752929087851944",
      "type": "constraint"
    },
    {
      "access": "public",
      "destination": "580575003920044707",
      "label": "c",
      "source": "1719752929087851944",
      "type": "aggregation"
    },
    {
      "access": "public",
      "destination": "1651810571114530033",
      "source": "1373403346245688670",
      "type": "dependency"
    },
    {
      "access": "public",
      "destination": "1157378014768957235",
      "source": "1373403346245688670",
      "type": "instantiation"
    },
    {
      "access": "public",
      "destination": "1651810571114530033",
      "source": "2024276012622729482",
      "type": "dependency"
    },
    {
      "access": "public",
      "destination": "1719752929087851944",
      "source": "2024276012622729482",
      "type": "instantiation"
    },
    {
      "access": "public",
      "destination": "1178194542408300737",
      "label": "a",
      "source": "1082111961413727438",
      "type": "association"
    },
    {
      "access": "public",
      "destination": "1373403346245688670",
      "label": "c",
      "source": "1082111961413727438",
      "type": "aggregation"
    },
    {
      "access": "public",
      "destination": "2024276012622729482",
      "label": "d",
      "source": "1082111961413727438",
      "type": "aggregation"
    }
  ],
  "using_namespace": "clanguml::t00065"
}
```
