33 const std::string &full_name)
const
35 return find<source_file>(full_name);
41 return find<source_file>(
id);
47 if (find<source_file>(f->id()))
50 LOG_DBG(
"Adding source file: {}, {}", f->name(), f->fs_path().string());
54 assert(!ff.name().empty());
55 assert(ff.id().value() != 0);
59 if (!f->path().is_empty()) {
64 for (
const auto &directory : f->path()) {
65 auto source_file_path = parent_path_so_far | directory;
66 if (parent_path_so_far.is_empty())
67 source_file_path = {directory};
69 auto dir = std::make_unique<common::model::source_file>(
70 std::filesystem::path{source_file_path.to_string()});
73 assert(!dir->name().empty());
78 LOG_DBG(
"Added directory '{}' at path '{}'", directory,
79 parent_path_so_far.to_string());
82 parent_path_so_far.append(directory);
89 element_view<source_file>::add(ff);
95 return element_view<source_file>::view();
103 std::filesystem::path namePath{
name};
104 auto namePreferred = namePath.make_preferred().string();
106 auto element_opt =
get(namePreferred);
111 auto fully_qualified_name = ns | namePreferred;
112 element_opt =
get(fully_qualified_name.to_string());
121 std::set<eid_t> to_remove;
123 for (
auto &f : element_view<source_file>::view())
126 to_remove.emplace(f.get().id());
129 for (
auto &sf : element_view<source_file>::view())
130 sf.get().apply_filter(
filter(), to_remove);
132 element_view<source_file>::remove(to_remove);
143bool check_diagram_type<include_diagram::model::diagram>(
diagram_t t)
145 return t == diagram_t::kInclude;