Manager: Add generic dotfile looping

This commit is contained in:
Riyyi
2021-09-23 00:38:48 +02:00
parent de4b96bd47
commit 7920b7280e
2 changed files with 17 additions and 6 deletions
+3
View File
@@ -7,7 +7,9 @@
#ifndef DOTFILE_H
#define DOTFILE_H
#include <cstddef> // size_t
#include <filesystem>
#include <functional> // function
#include <string>
#include <vector>
@@ -37,6 +39,7 @@ public:
static void setExcludePaths(const std::vector<ExcludePath>& excludePaths) { s_excludePaths = excludePaths; }
private:
static void forEachDotfile(const std::vector<std::string>& targets, const std::function<void(std::filesystem::directory_entry, size_t)>& callback);
static bool filter(const std::filesystem::path& path);
static bool include(const std::filesystem::path& path, const std::vector<std::string>& targets);