MCPcopy Create free account
hub / github.com/WolfireGames/overgrowth / ReturnPaths

Method ReturnPaths

Source/Scripting/scriptfile.cpp:401–418  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

399}
400
401void ScriptFileUtil::ReturnPaths(const Path& script_path, PathSet& path_set) {
402 path_set.insert("script " + script_path.GetOriginalPathStr());
403 const ScriptFile& script_file = *ScriptFileUtil::GetScriptFile(script_path);
404 const std::string& script = script_file.contents;
405 std::string load_path;
406 std::string type;
407 std::string::size_type index = 0;
408 while (1) {
409 index = script.find("\"Data/", index); // Set index to first quote of "Data/" path
410 if (index == std::string::npos) {
411 break;
412 }
413 ++index; // Set index to first character of Data/ path
414 std::string::size_type end_quote = script.find('\"', index); // Find last quote
415 load_path = script.substr(index, end_quote - index);
416 ReturnPathUtil::ReturnPathsFromPath(load_path, path_set);
417 }
418}
419
420void ScriptFileCache::Dispose() {
421 files.clear();

Callers

nothing calls this directly

Calls 3

GetOriginalPathStrMethod · 0.80
insertMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected