Fixed formatting

This commit is contained in:
Bartek Kryza
2022-04-10 13:33:36 +02:00
parent f4d4633ece
commit 8e8945328e
7 changed files with 10 additions and 15 deletions

View File

@@ -347,7 +347,6 @@ void diagram_filter::init_filters(const config::diagram &c)
element_filters.emplace_back(std::make_unique<context_filter>( element_filters.emplace_back(std::make_unique<context_filter>(
filter_t::kInclusive, c.include().context)); filter_t::kInclusive, c.include().context));
inclusive_.emplace_back(std::make_unique<anyof_filter>( inclusive_.emplace_back(std::make_unique<anyof_filter>(
filter_t::kInclusive, std::move(element_filters))); filter_t::kInclusive, std::move(element_filters)));
} }

View File

@@ -135,8 +135,8 @@ struct paths_filter : public filter_visitor {
paths_filter(filter_t type, const std::filesystem::path &root, paths_filter(filter_t type, const std::filesystem::path &root,
std::vector<std::filesystem::path> p); std::vector<std::filesystem::path> p);
tvl::value_t match(const diagram &d, tvl::value_t match(
const common::model::source_file &r) const override; const diagram &d, const common::model::source_file &r) const override;
private: private:
std::vector<std::filesystem::path> paths_; std::vector<std::filesystem::path> paths_;
@@ -162,9 +162,7 @@ public:
return false; return false;
auto inc = tvl::all_of(inclusive_.begin(), inclusive_.end(), auto inc = tvl::all_of(inclusive_.begin(), inclusive_.end(),
[this, &e](const auto &in) { [this, &e](const auto &in) { return in->match(diagram_, e); });
return in->match(diagram_, e);
});
if (tvl::is_undefined(inc) || tvl::is_true(inc)) if (tvl::is_undefined(inc) || tvl::is_true(inc))
return true; return true;

View File

@@ -52,8 +52,7 @@ public:
} }
template <typename V = T> template <typename V = T>
void add_element( void add_element(const Path &path, std::unique_ptr<V> p)
const Path &path, std::unique_ptr<V> p)
{ {
assert(p); assert(p);

View File

@@ -45,8 +45,8 @@ void diagram::add_file(std::unique_ptr<common::model::source_file> &&f)
add_element(p, std::move(f)); add_element(p, std::move(f));
} }
type_safe::optional_ref<const common::model::source_file> type_safe::optional_ref<const common::model::source_file> diagram::get_file(
diagram::get_file(const std::string &name) const const std::string &name) const
{ {
for (const auto &p : files_) { for (const auto &p : files_) {
if (p.get().full_name(false) == name) { if (p.get().full_name(false) == name) {

View File

@@ -145,6 +145,5 @@ void translation_unit_visitor::process_file(const std::string &file,
ctx.diagram().add_file(std::move(f)); ctx.diagram().add_file(std::move(f));
} }
} }
} }
} }

View File

@@ -17,17 +17,17 @@
*/ */
#pragma once #pragma once
#include "common/model/enums.h"
#include "common/model/package.h"
#include "config/config.h" #include "config/config.h"
#include "cx/cursor.h" #include "cx/cursor.h"
#include "include_diagram/model/diagram.h" #include "include_diagram/model/diagram.h"
#include "include_diagram/visitor/translation_unit_context.h" #include "include_diagram/visitor/translation_unit_context.h"
#include "common/model/enums.h"
#include "common/model/package.h"
#include <clang-c/CXCompilationDatabase.h> #include <clang-c/CXCompilationDatabase.h>
#include <clang-c/Index.h> #include <clang-c/Index.h>
#include <cppast/visitor.hpp>
#include <cppast/cpp_preprocessor.hpp> #include <cppast/cpp_preprocessor.hpp>
#include <cppast/visitor.hpp>
#include <type_safe/reference.hpp> #include <type_safe/reference.hpp>
#include <functional> #include <functional>

View File

@@ -202,7 +202,7 @@ template <>
bool starts_with( bool starts_with(
const std::filesystem::path &path, const std::filesystem::path &prefix) const std::filesystem::path &path, const std::filesystem::path &prefix)
{ {
if(path == prefix) if (path == prefix)
return true; return true;
const int path_length = std::distance(std::begin(path), std::end(path)); const int path_length = std::distance(std::begin(path), std::end(path));