MCPcopy Create free account
hub / github.com/ElyPrismLauncher/Launcher / pathDepth

Function pathDepth

launcher/FileSystem.cpp:722–736  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

720}
721
722int pathDepth(const QString& path)
723{
724 if (path.isEmpty())
725 return 0;
726
727 QFileInfo info(path);
728
729 auto parts = QDir::toNativeSeparators(info.path()).split(QDir::separator(), Qt::SkipEmptyParts);
730
731 int numParts = parts.length();
732 numParts -= parts.count(".");
733 numParts -= parts.count("..") * 2;
734
735 return numParts;
736}
737
738QString pathTruncate(const QString& path, int depth)
739{

Callers 3

make_link_listMethod · 0.85
pathTruncateFunction · 0.85
test_path_depthMethod · 0.85

Calls 3

isEmptyMethod · 0.45
pathMethod · 0.45
countMethod · 0.45

Tested by 1

test_path_depthMethod · 0.68