From 375799fa79d1af76f33299acc20a11a167a021f8 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Thu, 17 Aug 2023 12:32:50 +0200 Subject: project: restructure libraries and build env --- source/lib/src/filesystem.cpp | 31 ------------------------------- 1 file changed, 31 deletions(-) delete mode 100644 source/lib/src/filesystem.cpp (limited to 'source/lib/src/filesystem.cpp') diff --git a/source/lib/src/filesystem.cpp b/source/lib/src/filesystem.cpp deleted file mode 100644 index 35b6b40..0000000 --- a/source/lib/src/filesystem.cpp +++ /dev/null @@ -1,31 +0,0 @@ -#include "wanda/filesystem.hpp" - -#include -#include - -namespace wanda -{ - std::optional scan(std::filesystem::path source, bool(filter)(std::filesystem::path const &)) - { - if (!std::filesystem::is_directory(source)) - { - return std::nullopt; - } - auto entries = std::filesystem::recursive_directory_iterator{source}; - auto result = path_list{}; - for (auto & entry : entries | std::views::filter(filter)) - { - result.push_back(entry.path()); - } - return result; - } - - std::filesystem::path random_pick(path_list const & paths) - { - static auto generator = std::mt19937{std::random_device{}()}; - auto distribution = std::uniform_int_distribution{0, paths.size() - 1}; - - return paths[distribution(generator)]; - } - -} // namespace wanda \ No newline at end of file -- cgit v1.2.3