| 1 | // |
|---|---|
| 2 | // Copyright (c) 2023 Alan de Freitas (alandefreitas@gmail.com) |
| 3 | // |
| 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying |
| 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |
| 6 | // |
| 7 | // Official repository: https://github.com/boostorg/url |
| 8 | // |
| 9 | |
| 10 | #ifndef BOOST_URL_RFC_DETAIL_IPV6ADDRZ_RULE_HPP |
| 11 | #define BOOST_URL_RFC_DETAIL_IPV6ADDRZ_RULE_HPP |
| 12 | |
| 13 | #include "boost/url/error_types.hpp" |
| 14 | #include "boost/url/ipv6_address.hpp" |
| 15 | #include "boost/url/pct_string_view.hpp" |
| 16 | #include <boost/core/detail/string_view.hpp> |
| 17 | |
| 18 | namespace boost { |
| 19 | namespace urls { |
| 20 | namespace detail { |
| 21 | |
| 22 | /** Rule for IPvFuture |
| 23 | |
| 24 | @par BNF |
| 25 | @code |
| 26 | IPv6addrz = IPv6address "%25" ZoneID |
| 27 | ZoneID = 1*( unreserved / pct-encoded ) |
| 28 | @endcode |
| 29 | |
| 30 | @par Specification |
| 31 | @li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2" |
| 32 | >3.2.2. Host (rfc3986)</a> |
| 33 | */ |
| 34 | struct ipv6_addrz_rule_t |
| 35 | { |
| 36 | struct value_type |
| 37 | { |
| 38 | ipv6_address ipv6; |
| 39 | pct_string_view zone_id; |
| 40 | }; |
| 41 | |
| 42 | auto |
| 43 | parse( |
| 44 | char const*& it, |
| 45 | char const* const end |
| 46 | ) const noexcept -> |
| 47 | system::result<value_type>; |
| 48 | }; |
| 49 | |
| 50 | constexpr ipv6_addrz_rule_t ipv6_addrz_rule{}; |
| 51 | |
| 52 | } // detail |
| 53 | } // urls |
| 54 | } // boost |
| 55 | |
| 56 | #endif |
| 57 |
