| 16695 | } |
| 16696 | |
| 16697 | constexpr bool is_absolute_pathname( |
| 16698 | std::string_view input, url_pattern_init::process_type type) noexcept { |
| 16699 | // If input is the empty string, then return false. |
| 16700 | if (input.empty()) [[unlikely]] { |
| 16701 | return false; |
| 16702 | } |
| 16703 | // If input[0] is U+002F (/), then return true. |
| 16704 | if (input.starts_with("/")) return true; |
| 16705 | // If type is "url", then return false. |
| 16706 | if (type == url_pattern_init::process_type::url) return false; |
| 16707 | // If input's code point length is less than 2, then return false. |
| 16708 | if (input.size() < 2) return false; |
| 16709 | // If input[0] is U+005C (\) and input[1] is U+002F (/), then return true. |
| 16710 | // If input[0] is U+007B ({) and input[1] is U+002F (/), then return true. |
| 16711 | // Return false. |
| 16712 | return input[1] == '/' && (input[0] == '\\' || input[0] == '{'); |
| 16713 | } |
| 16714 | |
| 16715 | std::string generate_pattern_string( |
| 16716 | std::vector<url_pattern_part>& part_list, |