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

Function SliceAbstractPath

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

Source from the content-addressed store, hash-verified

66}
67
68std::string SliceAbstractPath(const std::string& s, int offset, int length, char sep) {
69 if (offset < 0 || length < 0) {
70 return "";
71 }
72 std::vector<std::string> components = SplitAbstractPath(s, sep);
73 if (offset >= static_cast<int>(components.size())) {
74 return "";
75 }
76 const auto end = std::min(static_cast<size_t>(offset) + length, components.size());
77 std::stringstream combined;
78 for (auto i = static_cast<size_t>(offset); i < end; i++) {
79 combined << components[i];
80 if (i < end - 1) {
81 combined << sep;
82 }
83 }
84 return combined.str();
85}
86
87int GetAbstractPathDepth(std::string_view path) {
88 if (path.empty()) {

Callers 2

ToFileInfosMethod · 0.85
TESTFunction · 0.85

Calls 3

SplitAbstractPathFunction · 0.85
strMethod · 0.80
sizeMethod · 0.45

Tested by 1

TESTFunction · 0.68