MCPcopy Create free account
hub / github.com/DFHack/dfhack / addScriptPath

Method addScriptPath

library/Core.cpp:461–471  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

459}
460
461bool Core::addScriptPath(std::filesystem::path path, bool search_before)
462{
463 std::lock_guard<std::mutex> lock(script_path_mutex);
464 auto &vec = script_paths[search_before ? 0 : 1];
465 if (std::find(vec.begin(), vec.end(), path) != vec.end())
466 return false;
467 if (!Filesystem::isdir(path))
468 return false;
469 vec.push_back(path);
470 return true;
471}
472
473bool Core::setModScriptPaths(const std::vector<std::filesystem::path> &mod_script_paths) {
474 std::lock_guard<std::mutex> lock(script_path_mutex);

Callers 2

loadScriptPathsFunction · 0.80
internal_addScriptPathFunction · 0.80

Calls 3

findFunction · 0.50
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected