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 //
0004 // Distributed under the Boost Software License, Version 1.0. (See accompanying
0005 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0006 //
0007 // Official repository: https://github.com/boostorg/url
0008 //
0009 
0010 #ifndef BOOST_URL_RFC_DETAIL_HOST_RULE_HPP
0011 #define BOOST_URL_RFC_DETAIL_HOST_RULE_HPP
0012 
0013 #include <boost/url/host_type.hpp>
0014 #include <boost/url/error_types.hpp>
0015 #include <boost/url/pct_string_view.hpp>
0016 #include <boost/url/ipv4_address.hpp>
0017 #include <boost/url/ipv6_address.hpp>
0018 
0019 namespace boost {
0020 namespace urls {
0021 namespace detail {
0022 
0023 /** Rule for host
0024 
0025     @par BNF
0026     @code
0027     host          = IP-literal / IPv4address / reg-name
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 host_type,
0036         @ref ipv4_address,
0037         @ref ipv6_address.
0038 */
0039 struct host_rule_t
0040 {
0041     struct value_type
0042     {
0043         urls::host_type host_type =
0044             urls::host_type::none;
0045         core::string_view match;
0046         unsigned char addr[16] = {};
0047         pct_string_view name;
0048     };
0049 
0050     auto
0051     parse(
0052         char const*& it,
0053         char const* end
0054             ) const noexcept ->
0055         system::result<value_type>;
0056 };
0057 
0058 constexpr host_rule_t host_rule{};
0059 
0060 } // detail
0061 } // urls
0062 } // boost
0063 
0064 #endif