# t40001 - Basic include graph diagram test case ## Config ```yaml diagrams: t40001_include: type: include title: Basic include diagram example # Provide the files to parse in order to look # for #include directives glob: - src/t40001.cc # Include also external system headers generate_system_headers: true include: # Include only headers belonging to these paths paths: - . plantuml: before: - "' t40001 test diagram of type {{ diagram.type }}" after: - 'note right of {{ alias("include/lib1") }}: This is a lib1 include dir' - 'note right of {{ alias("include/t40001_include1.h") }}: This is a t40001_include1.h include file' mermaid: before: - "%% t40001 test diagram of type {{ diagram.type }}" after: - 'N_00001(This is a lib1 include dir)-.-{{ alias("include/lib1") }}' - 'N_00002(This is a t40001_include1.h include file)-.-{{ alias("include/t40001_include1.h") }}' ``` ## Source code File `tests/t40001/src/t40001.cc` ```cpp #include #include #include "../include/t40001_include1.h" namespace clanguml { namespace t40001 { } // namespace t40001 } // namespace clanguml ``` File `tests/t40001/include/t40001_include1.h` ```cpp #pragma once #include "lib1/lib1.h" #include #include namespace clanguml::t40001 { int foo() { return lib1::foo2(); } } ``` File `tests/t40001/include/lib1/lib1.h` ```cpp #pragma once namespace clanguml::t40001::lib1 { int foo2() { return 0; } } ``` ## Generated PlantUML diagrams ![t40001_include](./t40001_include.svg "Basic include graph diagram test case") ## Generated Mermaid diagrams ![t40001_include](./t40001_include_mermaid.svg "Basic include graph diagram test case") ## Generated JSON models ```json { "diagram_type": "include", "elements": [ { "display_name": "src", "elements": [ { "display_name": "src/t40001.cc", "file_kind": "implementation", "id": "1755015016680017839", "name": "t40001.cc", "type": "file" } ], "id": "1387619747296316447", "name": "src", "type": "folder" }, { "display_name": "string", "file_kind": "header", "id": "1687197357150905926", "is_system": true, "name": "string", "type": "file" }, { "display_name": "vector", "file_kind": "header", "id": "405203884025072971", "is_system": true, "name": "vector", "type": "file" }, { "display_name": "include", "elements": [ { "display_name": "include/t40001_include1.h", "file_kind": "header", "id": "1926692816440595520", "is_system": false, "name": "t40001_include1.h", "type": "file" }, { "display_name": "include/lib1", "elements": [ { "display_name": "include/lib1/lib1.h", "file_kind": "header", "id": "2193549214042244690", "is_system": false, "name": "lib1.h", "type": "file" } ], "id": "1687675335949018432", "name": "lib1", "type": "folder" } ], "id": "989412417490706876", "name": "include", "type": "folder" }, { "display_name": "yaml-cpp/yaml.h", "file_kind": "header", "id": "1659736894483045485", "is_system": true, "name": "yaml-cpp/yaml.h", "type": "file" } ], "name": "t40001_include", "relationships": [ { "destination": "1687197357150905926", "source": "1755015016680017839", "type": "dependency" }, { "destination": "405203884025072971", "source": "1755015016680017839", "type": "dependency" }, { "destination": "1926692816440595520", "source": "1755015016680017839", "type": "association" }, { "destination": "2193549214042244690", "source": "1926692816440595520", "type": "association" }, { "destination": "1659736894483045485", "source": "1926692816440595520", "type": "dependency" }, { "destination": "1687197357150905926", "source": "1926692816440595520", "type": "dependency" } ], "title": "Basic include diagram example" } ```