A helper for SetUrlAndParse() below. kGe0Prefixes supports API and ge0 links, kLegacyMwmPrefixes - only API.
| 102 | // A helper for SetUrlAndParse() below. |
| 103 | // kGe0Prefixes supports API and ge0 links, kLegacyMwmPrefixes - only API. |
| 104 | std::tuple<size_t, bool> FindUrlPrefix(std::string const & url) |
| 105 | { |
| 106 | for (auto const prefix : ge0::Ge0Parser::kGe0Prefixes) |
| 107 | if (url.starts_with(prefix)) |
| 108 | return {prefix.size(), true}; |
| 109 | for (auto const prefix : kLegacyMwmPrefixes) |
| 110 | if (url.starts_with(prefix)) |
| 111 | return {prefix.size(), false}; |
| 112 | return {std::string::npos, false}; |
| 113 | } |
| 114 | } // namespace |
| 115 | |
| 116 | ParsedMapApi::UrlType ParsedMapApi::SetUrlAndParse(std::string const & raw) |