MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / cf_SetSearchPath

Function cf_SetSearchPath

cfile/cfile.cpp:205–220  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

203}
204
205bool 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

Callers 5

mng_InitLocalTablesFunction · 0.85
mng_InitNetTablesFunction · 0.85
mng_InitLocalDirectoriesFunction · 0.85
InitIOFunction · 0.85
TESTFunction · 0.85

Calls

no outgoing calls

Tested by 1

TESTFunction · 0.68