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

Method findRefInFiltered

apps/tools/Studio/StudioApp.cpp:377–395  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

375}
376
377int StudioApp::findRefInFiltered(const std::string& refName) const
378{
379 std::string norm = normalizePath(refName);
380 if (norm.empty())
381 return -1;
382 for (int i = 0; i < (int)filteredFiles.size(); i++)
383 {
384 std::string fname = normalizePath(filteredFiles[i].name);
385 if (fname == norm)
386 return i;
387 if (fname.size() > norm.size() && fname[fname.size() - norm.size() - 1] == '/' &&
388 fname.compare(fname.size() - norm.size(), norm.size(), norm) == 0)
389 return i;
390 if (norm.size() > fname.size() && norm[norm.size() - fname.size() - 1] == '/' &&
391 norm.compare(norm.size() - fname.size(), fname.size(), fname) == 0)
392 return i;
393 }
394 return -1;
395}
396
397void StudioApp::selectFoundRefs(const std::vector<AssetRef>& refs)
398{

Callers

nothing calls this directly

Calls 3

normalizePathFunction · 0.85
sizeMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected