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

Method GetLatestModification

Source/Scripting/scriptfile.cpp:377–395  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

375}
376
377int64_t ScriptFileUtil::GetLatestModification(const Path& path) {
378 PROFILER_ZONE(g_profiler_ctx, "GetLatestModification");
379 ScriptFileMap& file_map = ScriptFileCache::Instance()->files;
380 ScriptFileMap::iterator iter;
381 iter = file_map.find(path.GetFullPathStr());
382 if (iter == file_map.end()) {
383 DisplayError("Error", "Getting latest modification of unloaded script");
384 return 0;
385 } else {
386 ScriptFile& file = (*iter).second;
387 std::vector<Dependency>::iterator iter = file.dependencies.begin();
388 int64_t latest_modification = GetDateModifiedInt64((*iter).path);
389 ++iter;
390 for (; iter != file.dependencies.end(); ++iter) {
391 latest_modification = max(latest_modification, GetDateModifiedInt64((*iter).path));
392 }
393 return latest_modification;
394 }
395}
396
397const ScriptFile* ScriptFileUtil::GetScriptFile(const Path& path) {
398 return GetScriptFileRecursive(NULL, path);

Callers

nothing calls this directly

Calls 7

GetDateModifiedInt64Function · 0.85
maxFunction · 0.85
GetFullPathStrMethod · 0.80
DisplayErrorFunction · 0.50
findMethod · 0.45
endMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected