MCPcopy Create free account
hub / github.com/apache/arrow / GetAbstractPathDepth

Function GetAbstractPathDepth

cpp/src/arrow/filesystem/path_util.cc:87–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85}
86
87int GetAbstractPathDepth(std::string_view path) {
88 if (path.empty()) {
89 return 0;
90 }
91 int depth = static_cast<int>(std::count(path.begin(), path.end(), kSep)) + 1;
92 if (path.back() == kSep) {
93 depth -= 1;
94 }
95 if (path.front() == kSep) {
96 depth -= 1;
97 }
98 return depth;
99}
100
101std::pair<std::string, std::string> GetAbstractPathParent(const std::string& s) {
102 // XXX should strip trailing slash?

Callers 3

ToFileInfosMethod · 0.85
TESTFunction · 0.85

Calls 5

countFunction · 0.85
backMethod · 0.80
emptyMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by 1

TESTFunction · 0.68