MCPcopy Create free account
hub / github.com/MayaPosch/NymphCast / removeCommonPath

Function removeCommonPath

src/server/gui/core/utils/FileSystemUtil.cpp:558–574  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

556//////////////////////////////////////////////////////////////////////////
557
558 std::string removeCommonPath(const std::string& _path, const std::string& _common, bool& _contains)
559 {
560 const std::string path = getGenericPath(_path);
561 const std::string common = isDirectory(_common) ? getGenericPath(_common) : getParent(_common);
562
563 // check if path contains common
564 if(path.find(common) == 0)
565 {
566 _contains = true;
567 return path.substr(common.length() + 1);
568 }
569
570 // it didn't
571 _contains = false;
572 return path;
573
574 } // removeCommonPath
575
576//////////////////////////////////////////////////////////////////////////
577

Callers 2

createRelativePathFunction · 0.85
findOrCreateFileFunction · 0.85

Calls 5

getGenericPathFunction · 0.85
isDirectoryFunction · 0.85
getParentFunction · 0.85
lengthMethod · 0.80
findMethod · 0.45

Tested by

no test coverage detected