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

Function createRelativePath

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

Source from the content-addressed store, hash-verified

531//////////////////////////////////////////////////////////////////////////
532
533 std::string createRelativePath(const std::string& _path, const std::string& _relativeTo, const bool _allowHome)
534 {
535 bool contains = false;
536 std::string path = removeCommonPath(_path, _relativeTo, contains);
537
538 // success
539 if(contains)
540 return ("./" + path);
541
542 if(_allowHome)
543 {
544 path = removeCommonPath(_path, getHomePath(), contains);
545
546 // success
547 if(contains)
548 return ("~/" + path);
549 }
550
551 // nothing to resolve
552 return path;
553
554 } // createRelativePath
555
556//////////////////////////////////////////////////////////////////////////
557

Callers 2

addFileDataNodeFunction · 0.85
appendToXMLMethod · 0.85

Calls 2

removeCommonPathFunction · 0.85
getHomePathFunction · 0.85

Tested by

no test coverage detected