Manager: Rename filter() -> match()

The function returns true on a pattern match, so reflect this in the
name.
This commit is contained in:
Riyyi
2022-03-08 00:06:01 +01:00
parent 37be9506c8
commit 3b4ea3f42d
3 changed files with 6 additions and 6 deletions
+3 -3
View File
@@ -106,7 +106,7 @@ void Dotfile::push(const std::vector<std::string>& targets)
pullOrPush(SyncType::Push, targets);
}
bool Dotfile::filter(const std::filesystem::directory_entry& path,
bool Dotfile::match(const std::filesystem::directory_entry& path,
const std::vector<std::string>& patterns)
{
std::string pathString = path.path().string();
@@ -490,11 +490,11 @@ void Dotfile::forEachDotfile(const std::vector<std::string>& targets, const std:
continue;
}
// Ignore pattern check
if (filter(path, Config::the().ignorePatterns())) {
if (match(path, Config::the().ignorePatterns())) {
continue;
}
// Include check
if (!targets.empty() && !filter(path, targets)) {
if (!targets.empty() && !match(path, targets)) {
continue;
}
callback(path, index++);
+2 -2
View File
@@ -30,8 +30,8 @@ public:
void pull(const std::vector<std::string>& targets = {});
void push(const std::vector<std::string>& targets = {});
bool filter(const std::filesystem::directory_entry& path,
const std::vector<std::string>& patterns);
bool match(const std::filesystem::directory_entry& path,
const std::vector<std::string>& patterns);
private:
void pullOrPush(SyncType type, const std::vector<std::string>& targets = {});