Initial commit

This commit is contained in:
Bartek Kryza
2021-02-07 23:13:52 +01:00
commit 8ccd4bc81e
26 changed files with 27626 additions and 0 deletions

View File

@@ -0,0 +1,88 @@
#pragma once
#include <clang-c/CXCompilationDatabase.h>
#include <clang-c/Index.h>
#include <spdlog/spdlog.h>
#include <functional>
#include <memory>
#include <string>
#include <variant>
namespace clanguml {
namespace model {
namespace class_diagram {
enum class scope_t { kPublic, kProtected, kPrivate };
enum class relationship_t {
kExtension,
kComposition,
kAggregation,
kContainment,
kOwnership,
kAssociation
};
struct element {
std::string name;
std::vector<std::string> namespace_;
};
struct class_element {
scope_t scope;
std::string name;
std::string type;
};
struct class_member : public class_element {
bool is_relationship{false};
};
struct method_argument {
std::string type;
std::string name;
};
struct class_method : public class_element {
std::vector<method_argument> arguments;
};
struct class_parent {
enum class access_t { kPublic, kProtected, kPrivate };
std::string name;
bool is_virtual{false};
access_t access;
};
struct class_relationship {
relationship_t type{relationship_t::kAssociation};
std::string destination;
std::string cardinality_source;
std::string cardinality_destination;
std::string label;
};
struct class_ : public element {
bool is_struct{false};
bool is_template{false};
std::vector<class_member> members;
std::vector<class_method> methods;
std::vector<class_parent> bases;
std::vector<std::string> inner_classes;
std::vector<class_relationship> relationships;
};
struct enum_ : public element {
std::vector<std::string> constants;
};
struct diagram {
std::string name;
std::vector<class_> classes;
std::vector<enum_> enums;
};
}
}
}