# t00065 - Class diagram with packages from directory structure
## Config
```yaml
compilation_database_dir: ..
output_directory: puml
diagrams:
  t00065_class:
    type: class
    glob:
      - t00065.cc
    relative_to: ../../../tests/t00065
    generate_packages: true
    package_type: directory
    include:
      namespaces:
        - clanguml::t00065
    using_namespace:
      - clanguml::t00065
```
## Source code
File 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;
};
}
}
```
## Generated UML diagrams
![t00065_class](./t00065_class.svg "Class diagram with packages from directory structure")
## Generated JSON models
```json
{
  "diagram_type": "class",
  "elements": [
    {
      "display_name": "module1",
      "elements": [
        {
          "display_name": "module1::submodule1a",
          "elements": [
            {
              "bases": [],
              "display_name": "clanguml::t00065::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": {
                "file": "../../clang-uml/tests/t00065/module1/submodule1a/submodule1a.h",
                "line": 6
              },
              "template_parameters": [],
              "type": "class"
            }
          ],
          "name": "submodule1a",
          "type": "directory"
        },
        {
          "constants": [
            "a",
            "b",
            "c"
          ],
          "display_name": "clanguml::t00065::ABC",
          "id": "2145362985538918973",
          "is_nested": false,
          "name": "ABC",
          "namespace": "clanguml::t00065",
          "source_location": {
            "file": "../../clang-uml/tests/t00065/module1/module1.h",
            "line": 8
          },
          "type": "enum"
        },
        {
          "constants": [
            "x",
            "y",
            "z"
          ],
          "display_name": "clanguml::t00065::XYZ",
          "id": "1435940218810141944",
          "is_nested": false,
          "name": "XYZ",
          "namespace": "clanguml::t00065",
          "source_location": {
            "file": "../../clang-uml/tests/t00065/module1/module1.h",
            "line": 10
          },
          "type": "enum"
        },
        {
          "bases": [],
          "display_name": "clanguml::t00065::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": {
                "file": "../../clang-uml/tests/t00065/module1/module1.h",
                "line": 13
              },
              "type": "clanguml::t00065::ABC"
            },
            {
              "access": "public",
              "is_static": false,
              "name": "xyz",
              "source_location": {
                "file": "../../clang-uml/tests/t00065/module1/module1.h",
                "line": 14
              },
              "type": "clanguml::t00065::XYZ"
            },
            {
              "access": "public",
              "is_static": false,
              "name": "pimpl",
              "source_location": {
                "file": "../../clang-uml/tests/t00065/module1/module1.h",
                "line": 15
              },
              "type": "detail::AImpl *"
            }
          ],
          "methods": [],
          "name": "A",
          "namespace": "clanguml::t00065",
          "source_location": {
            "file": "../../clang-uml/tests/t00065/module1/module1.h",
            "line": 12
          },
          "template_parameters": [],
          "type": "class"
        }
      ],
      "name": "module1",
      "type": "directory"
    },
    {
      "display_name": "module2",
      "elements": [
        {
          "display_name": "module2::concepts",
          "elements": [
            {
              "display_name": "clanguml::t00065::bconcept<T>",
              "id": "1325475407133721370",
              "name": "bconcept",
              "namespace": "clanguml::t00065",
              "parameters": [
                {
                  "name": "clanguml::t00065::t",
                  "type": "T"
                }
              ],
              "source_location": {
                "file": "../../clang-uml/tests/t00065/module2/concepts/concepts.h",
                "line": 7
              },
              "statements": [
                "T{}",
                "t.b()"
              ],
              "type": "concept"
            }
          ],
          "name": "concepts",
          "type": "directory"
        },
        {
          "bases": [],
          "display_name": "clanguml::t00065::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_defaulted": true,
              "is_implicit": false,
              "is_pure_virtual": false,
              "is_static": false,
              "is_virtual": false,
              "name": "B",
              "parameters": [],
              "type": "void"
            },
            {
              "access": "public",
              "is_const": false,
              "is_defaulted": false,
              "is_implicit": false,
              "is_pure_virtual": false,
              "is_static": false,
              "is_virtual": false,
              "name": "b",
              "parameters": [],
              "type": "void"
            }
          ],
          "name": "B",
          "namespace": "clanguml::t00065",
          "source_location": {
            "file": "../../clang-uml/tests/t00065/module2/module2.h",
            "line": 7
          },
          "template_parameters": [],
          "type": "class"
        },
        {
          "bases": [],
          "display_name": "clanguml::t00065::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": {
                "file": "../../clang-uml/tests/t00065/module2/module2.h",
                "line": 13
              },
              "type": "T *"
            }
          ],
          "methods": [],
          "name": "C",
          "namespace": "clanguml::t00065",
          "source_location": {
            "file": "../../clang-uml/tests/t00065/module2/module2.h",
            "line": 12
          },
          "template_parameters": [
            {
              "is_variadic": false,
              "kind": "template_type",
              "name": "T",
              "template_parameters": []
            }
          ],
          "type": "class"
        },
        {
          "bases": [],
          "display_name": "clanguml::t00065::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": {
            "file": "../../clang-uml/tests/t00065/module2/module2.h",
            "line": 12
          },
          "template_parameters": [
            {
              "is_variadic": false,
              "kind": "argument",
              "template_parameters": [],
              "type": "int"
            }
          ],
          "type": "class"
        },
        {
          "bases": [],
          "display_name": "clanguml::t00065::D<clanguml::t00065::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": {
                "file": "../../clang-uml/tests/t00065/module2/module2.h",
                "line": 17
              },
              "type": "T"
            },
            {
              "access": "public",
              "is_static": false,
              "name": "c",
              "source_location": {
                "file": "../../clang-uml/tests/t00065/module2/module2.h",
                "line": 18
              },
              "type": "C<int>"
            }
          ],
          "methods": [],
          "name": "D",
          "namespace": "clanguml::t00065",
          "source_location": {
            "file": "../../clang-uml/tests/t00065/module2/module2.h",
            "line": 16
          },
          "template_parameters": [
            {
              "is_variadic": false,
              "kind": "template_type",
              "name": "T",
              "template_parameters": []
            }
          ],
          "type": "class"
        },
        {
          "bases": [],
          "display_name": "clanguml::t00065::C<clanguml::t00065::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": {
            "file": "../../clang-uml/tests/t00065/module2/module2.h",
            "line": 12
          },
          "template_parameters": [
            {
              "is_variadic": false,
              "kind": "argument",
              "template_parameters": [],
              "type": "clanguml::t00065::B"
            }
          ],
          "type": "class"
        },
        {
          "bases": [],
          "display_name": "clanguml::t00065::D<clanguml::t00065::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": {
            "file": "../../clang-uml/tests/t00065/module2/module2.h",
            "line": 16
          },
          "template_parameters": [
            {
              "is_variadic": false,
              "kind": "argument",
              "template_parameters": [],
              "type": "clanguml::t00065::B"
            }
          ],
          "type": "class"
        }
      ],
      "name": "module2",
      "type": "directory"
    },
    {
      "bases": [],
      "display_name": "clanguml::t00065::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": {
            "file": "../../clang-uml/tests/t00065/t00065.cc",
            "line": 7
          },
          "type": "clanguml::t00065::A *"
        },
        {
          "access": "public",
          "is_static": false,
          "name": "c",
          "source_location": {
            "file": "../../clang-uml/tests/t00065/t00065.cc",
            "line": 8
          },
          "type": "C<clanguml::t00065::B>"
        },
        {
          "access": "public",
          "is_static": false,
          "name": "d",
          "source_location": {
            "file": "../../clang-uml/tests/t00065/t00065.cc",
            "line": 9
          },
          "type": "D<clanguml::t00065::B>"
        }
      ],
      "methods": [],
      "name": "R",
      "namespace": "clanguml::t00065",
      "source_location": {
        "file": "../../clang-uml/tests/t00065/t00065.cc",
        "line": 6
      },
      "template_parameters": [],
      "type": "class"
    }
  ],
  "metadata": {
    "clang_uml_version": "0.3.5-27-g81c7ce7",
    "llvm_version": "Ubuntu clang version 15.0.6",
    "schema_version": 1
  },
  "name": "t00065_class",
  "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"
}
```
