MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / AbsoluteResolvedModPath

Function AbsoluteResolvedModPath

engine/Poseidon/Core/ModCollection.cpp:97–113  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

95 return s;
96}
97
98std::string AbsoluteResolvedModPath(const std::filesystem::path& candidate)
99{
100 std::error_code ec;
101 const std::string abs = std::filesystem::absolute(candidate, ec).string();
102
103 char real[1024];
104 if (ResolveFilePath(abs.c_str(), real, sizeof(real)) && LooksLikeMod(real))
105 return real;
106
107 if (LooksLikeMod(abs))
108 {
109 const std::filesystem::path canonical = std::filesystem::weakly_canonical(abs, ec);
110 return canonical.empty() ? abs : canonical.string();
111 }
112
113 return {};
114}
115
116std::string JoinCandidatesForError(const std::vector<std::filesystem::path>& candidates)

Callers 1

ResolveModPathListFunction · 0.85

Calls 3

LooksLikeModFunction · 0.85
ResolveFilePathFunction · 0.50
emptyMethod · 0.45

Tested by

no test coverage detected