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

Function EnsureLeadingSlash

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

Source from the content-addressed store, hash-verified

170}
171
172std::string EnsureLeadingSlash(std::string_view v) {
173 if (!HasLeadingSlash(v)) {
174 // XXX How about "C:" on Windows? We probably don't want to turn it into "/C:"...
175 return kSep + std::string(v);
176 } else {
177 return std::string(v);
178 }
179}
180std::string_view RemoveTrailingSlash(std::string_view key, bool preserve_root) {
181 if (preserve_root && key.size() == 1) {
182 // If the user gives us "/" then don't return ""

Callers 3

TESTFunction · 0.85
GlobFilesFunction · 0.85
MakeAbstractPathRelativeFunction · 0.85

Calls 1

HasLeadingSlashFunction · 0.85

Tested by 1

TESTFunction · 0.68