| 113 | #endif |
| 114 | |
| 115 | bool 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 | |
| 135 | Result<std::string> PathFromUriHelper(const std::string& uri_string, |
| 136 | std::vector<std::string> supported_schemes, |