Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:53:28

0001 //
0002 // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com)
0003 // Copyright (c) 2022 Alan de Freitas (vinnie dot falco at gmail dot com)
0004 //
0005 // Distributed under the Boost Software License, Version 1.0. (See accompanying
0006 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0007 //
0008 // Official repository: https://github.com/boostorg/url
0009 //
0010 
0011 #ifndef BOOST_URL_RFC_DETAIL_IP_LITERAL_RULE_HPP
0012 #define BOOST_URL_RFC_DETAIL_IP_LITERAL_RULE_HPP
0013 
0014 #include <boost/url/detail/config.hpp>
0015 #include <boost/url/ipv6_address.hpp>
0016 #include <boost/url/error_types.hpp>
0017 #include <boost/core/detail/string_view.hpp>
0018 
0019 namespace boost {
0020 namespace urls {
0021 namespace detail {
0022 
0023 /** Rule for IP-literal
0024 
0025     @par BNF
0026     @code
0027     IP-literal = "[" ( IPv6address / IPv6addrz / IPvFuture  ) "]"
0028     @endcode
0029 
0030     @par Specification
0031     @li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2"
0032         >3.2.2. Host (rfc3986)</a>
0033 
0034     @see
0035         @ref ipv6_address.
0036 */
0037 struct ip_literal_rule_t
0038 {
0039     struct value_type
0040     {
0041         bool is_ipv6 = false;
0042         ipv6_address ipv6;
0043         core::string_view ipvfuture;
0044     };
0045 
0046     auto
0047     parse(
0048         char const*& it,
0049         char const* end
0050             ) const noexcept ->
0051         system::result<value_type>;
0052 };
0053 
0054 constexpr ip_literal_rule_t ip_literal_rule{};
0055 
0056 } // detail
0057 } // urls
0058 } // boost
0059 
0060 #endif