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

Function DetectAbsolutePath

cpp/src/arrow/filesystem/util_internal.cc:115–133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

113#endif
114
115bool DetectAbsolutePath(const std::string& s) {
116 // Is it a /-prefixed local path?
117 if (s.length() >= 1 && s[0] == '/') {
118 return true;
119 }
120#ifdef _WIN32
121 // Is it a \-prefixed local path?
122 if (s.length() >= 1 && s[0] == '\\') {
123 return true;
124 }
125 // Does it start with a drive letter in addition to being /- or \-prefixed,
126 // e.g. "C:\..."?
127 if (s.length() >= 3 && s[1] == ':' && (s[2] == '/' || s[2] == '\\') &&
128 IsDriveLetter(s[0])) {
129 return true;
130 }
131#endif
132 return false;
133}
134
135Result<std::string> PathFromUriHelper(const std::string& uri_string,
136 std::vector<std::string> supported_schemes,

Callers 4

MakeUriMethod · 0.85
FileSystemFromUriOrPathFunction · 0.85
ASSERT_OK_AND_ASSIGNFunction · 0.85
PathFromUriHelperFunction · 0.85

Calls 2

IsDriveLetterFunction · 0.85
lengthMethod · 0.45

Tested by 1

ASSERT_OK_AND_ASSIGNFunction · 0.68