aboutsummaryrefslogtreecommitdiff
path: root/src/wanda/filesystem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/wanda/filesystem.cpp')
-rw-r--r--src/wanda/filesystem.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/wanda/filesystem.cpp b/src/wanda/filesystem.cpp
index d94894a..4da30b1 100644
--- a/src/wanda/filesystem.cpp
+++ b/src/wanda/filesystem.cpp
@@ -1,8 +1,7 @@
#include <wanda/filesystem.hpp>
-#include <range/v3/all.hpp>
-
#include <random>
+#include <ranges>
namespace wanda
{
@@ -12,10 +11,13 @@ namespace wanda
{
return std::nullopt;
}
-
- auto begin = std::filesystem::recursive_directory_iterator{source};
- auto end = std::filesystem::recursive_directory_iterator{};
- return ranges::make_iterator_range(begin, end) | ranges::view::filter(filter);
+ 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)