aboutsummaryrefslogtreecommitdiff
path: root/source/lib/src/filesystem.cpp
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@gmail.com>2023-08-17 12:32:50 +0200
committerFelix Morgner <felix.morgner@gmail.com>2023-08-17 12:32:50 +0200
commit375799fa79d1af76f33299acc20a11a167a021f8 (patch)
tree8f91b982ec96225c33a2f4871730ababffe5cab0 /source/lib/src/filesystem.cpp
parentaf471b9b780869915d3217b228e24d025892de47 (diff)
downloadwanda-375799fa79d1af76f33299acc20a11a167a021f8.tar.xz
wanda-375799fa79d1af76f33299acc20a11a167a021f8.zip
project: restructure libraries and build env
Diffstat (limited to 'source/lib/src/filesystem.cpp')
-rw-r--r--source/lib/src/filesystem.cpp31
1 files changed, 0 insertions, 31 deletions
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 <random>
-#include <ranges>
-
-namespace wanda
-{
- std::optional<path_list> 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<std::size_t>{0, paths.size() - 1};
-
- return paths[distribution(generator)];
- }
-
-} // namespace wanda \ No newline at end of file