| 203 | } |
| 204 | |
| 205 | bool cf_SetSearchPath(const std::filesystem::path &path, const std::vector<std::filesystem::path> &ext_list) { |
| 206 | // Don't add non-existing path into search paths |
| 207 | if (!std::filesystem::is_directory(path)) |
| 208 | return false; |
| 209 | // Get & store full path |
| 210 | paths.insert_or_assign(std::filesystem::absolute(path), !ext_list.empty()); |
| 211 | // Set extensions for this path |
| 212 | if (!ext_list.empty()) { |
| 213 | for (auto const &ext : ext_list) { |
| 214 | if (!ext.empty()) { |
| 215 | extensions.insert_or_assign(ext, path); |
| 216 | } |
| 217 | } |
| 218 | } |
| 219 | return true; |
| 220 | } |
| 221 | |
| 222 | /** |
| 223 | * Removes all search paths that have been added by cf_SetSearchPath |
no outgoing calls