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

Function IsLikelyUri

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

Source from the content-addressed store, hash-verified

338}
339
340bool IsLikelyUri(std::string_view v) {
341 if (v.empty() || v[0] == '/') {
342 return false;
343 }
344 const auto pos = v.find_first_of(':');
345 if (pos == v.npos) {
346 return false;
347 }
348 if (pos < 2) {
349 // One-letter URI schemes don't officially exist, perhaps a Windows drive letter?
350 return false;
351 }
352 if (pos > 36) {
353 // The largest IANA-registered URI scheme is "microsoft.windows.camera.multipicker"
354 // with 36 characters.
355 return false;
356 }
357 return ::arrow::util::IsValidUriScheme(v.substr(0, pos));
358}
359
360struct Globber::Impl {
361 std::regex pattern_;

Callers 7

FromStringMethod · 0.85
ValidatePathFunction · 0.85
ValidateSubPathFunction · 0.85
FromStringMethod · 0.85
ResolveS3BucketRegionFunction · 0.85
ValidatePathFunction · 0.85
FromStringMethod · 0.85

Calls 3

IsValidUriSchemeFunction · 0.85
substrMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected