| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
#pragma once |
| 5 |
|
| 6 |
#include <span> |
| 7 |
#include <string> |
| 8 |
#include <string_view> |
| 9 |
#include <vector> |
| 10 |
|
| 11 |
namespace Common |
| 12 |
{ |
| 13 |
|
| 14 |
|
| 15 |
std::vector<std::string> DoFileSearch(std::span<const std::string_view> directories, |
| 16 |
std::span<const std::string_view> exts = {}, |
| 17 |
bool recursive = false); |
| 18 |
|
| 19 |
inline std::vector<std::string> DoFileSearch(std::span<const std::string_view> directories, |
| 20 |
std::string_view ext, bool recursive = false) |
| 21 |
{ |
| 22 |
return DoFileSearch(directories, std::span(&ext, 1), recursive); |
| 23 |
} |
| 24 |
|
| 25 |
inline std::vector<std::string> DoFileSearch(std::string_view directory, |
| 26 |
std::span<const std::string_view> exts = {}, |
| 27 |
bool recursive = false) |
| 28 |
{ |
| 29 |
return DoFileSearch(std::span(&directory, 1), exts, recursive); |
| 30 |
} |
| 31 |
|
| 32 |
inline std::vector<std::string> DoFileSearch(std::string_view directory, std::string_view ext, |
| 33 |
bool recursive = false) |
| 34 |
{ |
| 35 |
return DoFileSearch(std::span(&directory, 1), std::span(&ext, 1), recursive); |
| 36 |
} |
| 37 |
|
| 38 |
} |