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

Method StripBase

cpp/src/arrow/filesystem/filesystem.cc:332–341  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

330}
331
332Result<std::string> SubTreeFileSystem::StripBase(const std::string& s) const {
333 auto len = base_path_.length();
334 // Note base_path_ ends with a slash (if not empty)
335 if (s.length() >= len && s.substr(0, len) == base_path_) {
336 return s.substr(len);
337 } else {
338 return Status::UnknownError("Underlying filesystem returned path '", s,
339 "', which is not a subpath of '", base_path_, "'");
340 }
341}
342
343Status SubTreeFileSystem::FixInfo(FileInfo* info) const {
344 ARROW_ASSIGN_OR_RAISE(auto fixed_path, StripBase(info->path()));

Callers

nothing calls this directly

Calls 3

UnknownErrorFunction · 0.85
substrMethod · 0.80
lengthMethod · 0.45

Tested by

no test coverage detected