48 std::make_unique<access_filter>(
55 std::make_unique<access_filter>(
59 std::vector<std::unique_ptr<filter_visitor>> element_filters;
61 element_filters.emplace_back(std::make_unique<element_filter>(
64 element_filters.emplace_back(std::make_unique<element_type_filter>(
68 element_filters.emplace_back(std::make_unique<subclass_filter>(
71 element_filters.emplace_back(std::make_unique<parents_filter>(
74 element_filters.emplace_back(
79 element_filters.emplace_back(
80 std::make_unique<class_dependants_filter_t>(
84 element_filters.emplace_back(
85 std::make_unique<class_dependencies_filter_t>(
90 element_filters.emplace_back(std::make_unique<callee_filter>(
94 element_filters.emplace_back(
95 std::make_unique<package_dependants_filter_t>(
99 element_filters.emplace_back(
100 std::make_unique<package_dependencies_filter_t>(
105 std::vector<std::string> dependants;
106 std::vector<std::string> dependencies;
109 if (
auto p =
path.get<std::string>(); p.has_value()) {
110 const std::filesystem::path dep_path{*p};
111 dependants.emplace_back(
112 dep_path.lexically_normal().string());
117 if (
auto p =
path.get<std::string>(); p.has_value()) {
118 const std::filesystem::path dep_path{*p};
119 dependencies.emplace_back(
120 dep_path.lexically_normal().string());
124 element_filters.emplace_back(
125 std::make_unique<source_file_dependency_filter_t>(
129 element_filters.emplace_back(
130 std::make_unique<source_file_dependency_filter_t>(
135 element_filters.emplace_back(std::make_unique<context_filter>(
171 std::make_unique<access_filter>(
178 std::make_unique<access_filter>(
197 std::make_unique<class_dependencies_filter_t>(
207 std::make_unique<package_dependencies_filter_t>(
212 std::make_unique<package_dependants_filter_t>(
217 std::vector<std::string> dependants;
218 std::vector<std::string> dependencies;
221 if (
auto p =
path.get<std::string>(); p.has_value()) {
222 std::filesystem::path dep_path{*p};
223 dependants.emplace_back(
224 dep_path.lexically_normal().string());
229 if (
auto p =
path.get<std::string>(); p.has_value()) {
230 std::filesystem::path dep_path{*p};
231 dependencies.emplace_back(
232 dep_path.lexically_normal().string());
237 std::make_unique<source_file_dependency_filter_t>(
242 std::make_unique<source_file_dependency_filter_t>(
255 const std::vector<common::string_or_regex> &filter_config,
256 std::vector<std::unique_ptr<filter_visitor>> &result,
261 std::vector<std::string> deps;
262 for (
auto &&
path : filter_config) {
263 if (
auto p =
path.get<std::string>(); p.has_value()) {
264 const std::filesystem::path dep_path{*p};
265 deps.emplace_back(dep_path.lexically_normal().string());
269 result.emplace_back(std::make_unique<source_file_dependency_filter_t>(
270 filter_type, deps, rt, direction));
273std::vector<std::unique_ptr<filter_visitor>>
277 std::vector<std::unique_ptr<filter_visitor>> result;
281 if (filter_config.
allof) {
282 std::vector<std::unique_ptr<filter_visitor>> allof_filters =
285 auto allof_filter = std::make_unique<common::model::allof_filter>(
286 filter_type, std::move(allof_filters));
291 if (filter_config.
anyof) {
292 std::vector<std::unique_ptr<filter_visitor>> anyof_filters =
295 auto anyof_filter = std::make_unique<common::model::anyof_filter>(
296 filter_type, std::move(anyof_filters));
301 add_filter<namespace_filter>(filter_type, filter_config.
namespaces, result);
302 add_filter<modules_filter>(filter_type, filter_config.
modules, result);
303 add_filter<module_access_filter>(
305 add_filter<relationship_filter>(
307 add_filter<access_filter>(filter_type, filter_config.
access, result);
308 add_filter<method_type_filter>(
311 add_filter<paths_filter>(filter_type, filter_config.
paths, result,
314 add_filter<element_filter>(filter_type, filter_config.
elements, result);
315 add_filter<element_type_filter>(
317 add_filter<subclass_filter>(filter_type, filter_config.
subclasses, result);
318 add_filter<parents_filter>(filter_type, filter_config.
parents, result);
320 add_filter<specializations_filter_t>(filter_type,
323 add_filter<class_dependants_filter_t>(filter_type, filter_config.
dependants,
325 add_filter<class_dependencies_filter_t>(filter_type,
328 add_filter<callee_filter>(filter_type, filter_config.
callee_types, result);
330 add_filter<package_dependants_filter_t>(filter_type,
332 add_filter<package_dependencies_filter_t>(filter_type,
335 add_filter<context_filter>(filter_type, filter_config.
context, result);
338 add_filter<source_file_dependency_filter_t>(filter_type,
341 add_filter<source_file_dependency_filter_t>(filter_type,
352 auto inclusive_filter =
354 for (
auto &f : inclusive_filter)
359 auto exclusive_filter =
361 for (
auto &f : exclusive_filter)