| 338 | } |
| 339 | |
| 340 | bool 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 | |
| 360 | struct Globber::Impl { |
| 361 | std::regex pattern_; |
no test coverage detected