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

Function resolveVfsDisplayPath

apps/tools/Studio/StudioApp.cpp:352–375  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

350}
351
352static std::string resolveVfsDisplayPath(const std::string& enginePath)
353{
354 if (enginePath.empty() || !GUseFileBanks)
355 return {};
356 std::string epath = enginePath;
357 std::replace(epath.begin(), epath.end(), '/', '\\');
358 if (!epath.empty() && epath[0] == '\\')
359 epath = epath.substr(1);
360
361 QFBank* bank = QIFStreamB::AutoBank(epath.c_str());
362 if (!bank)
363 return {};
364 RString prefix = bank->GetPrefix();
365 const char* remainder = epath.c_str() + prefix.GetLength();
366 if (!bank->FileExists(remainder))
367 return {};
368 RString openName = bank->GetOpenName();
369 std::filesystem::path pboFsPath((const char*)openName);
370 std::string pboFilename = pboFsPath.filename().string();
371 std::string parentDir = pboFsPath.parent_path().filename().string();
372 std::string display = parentDir + "/" + pboFilename + "/" + std::string(remainder);
373 std::replace(display.begin(), display.end(), '\\', '/');
374 return display;
375}
376
377int StudioApp::findRefInFiltered(const std::string& refName) const
378{

Callers 1

updateCachedInfoMethod · 0.85

Calls 5

GetOpenNameMethod · 0.80
emptyMethod · 0.45
GetPrefixMethod · 0.45
GetLengthMethod · 0.45
FileExistsMethod · 0.45

Tested by

no test coverage detected