| 890 | } |
| 891 | |
| 892 | bool Content::visitDir(String path, const std::function<bool(String, String)>& func) { |
| 893 | std::function<bool(String)> visit; |
| 894 | visit = [&visit, &func, this](String path) { |
| 895 | auto files = getFiles(path); |
| 896 | for (const auto& file : files) { |
| 897 | if (func(file, path)) return true; |
| 898 | } |
| 899 | auto dirs = getDirs(path); |
| 900 | auto parent = fs::path(path.begin(), path.end()); |
| 901 | for (const auto& dir : dirs) { |
| 902 | if (visit((parent / dir).string())) return true; |
| 903 | } |
| 904 | return false; |
| 905 | }; |
| 906 | return visit(path); |
| 907 | } |
| 908 | |
| 909 | static std::tuple<std::string, std::string> splitDirectoryAndFilename(const std::string& filePath) { |
| 910 | std::string file = filePath; |