| 152 | } |
| 153 | |
| 154 | std::vector<std::filesystem::path> globFilesInDirectories( |
| 155 | const std::filesystem::path& path, |
| 156 | const std::regex& regexPattern, |
| 157 | fstd::span<std::filesystem::path> directories, |
| 158 | bool firstMatchOnly |
| 159 | ) |
| 160 | { |
| 161 | std::vector<std::filesystem::path> result; |
| 162 | |
| 163 | // Check if this is an absolute path. |
| 164 | if (path.is_absolute()) |
| 165 | { |
| 166 | result = globFilesInDirectory(path, regexPattern, firstMatchOnly); |
| 167 | } |
| 168 | else |
| 169 | { |
| 170 | // Search in other paths. |
| 171 | for (const auto& dir : directories) |
| 172 | { |
| 173 | std::filesystem::path fullPath = dir / path; |
| 174 | std::vector<std::filesystem::path> local = globFilesInDirectory(fullPath, regexPattern, firstMatchOnly); |
| 175 | result.reserve(result.size() + local.size()); |
| 176 | for (auto&& it : local) |
| 177 | result.push_back(std::move(it)); |
| 178 | if (firstMatchOnly && !result.empty()) |
| 179 | break; |
| 180 | } |
| 181 | } |
| 182 | |
| 183 | for (auto& it : result) |
| 184 | it = std::filesystem::canonical(it); |
| 185 | |
| 186 | return result; |
| 187 | } |
| 188 | |
| 189 | const std::vector<std::filesystem::path>& getShaderDirectoriesList() |
| 190 | { |
nothing calls this directly
no test coverage detected