Back to home page

EIC code displayed by LXR

 
 

    


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

0001 //
0002 // Copyright (c) 2019 Vinnie Falco (vinnie.falco@gmail.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_IPV4_ADDRESS_RULE_HPP
0011 #define BOOST_URL_RFC_IPV4_ADDRESS_RULE_HPP
0012 
0013 #include <boost/url/detail/config.hpp>
0014 #include <boost/url/ipv4_address.hpp>
0015 #include <boost/url/error_types.hpp>
0016 
0017 namespace boost {
0018 namespace urls {
0019 
0020 /** Rule for an IP version 4 style address
0021 
0022     @par Value Type
0023     @code
0024     using value_type = ipv4_address;
0025     @endcode
0026 
0027     @par Example
0028     Rules are used with the function @ref grammar::parse.
0029     @code
0030     system::result< ipv4_address > rv = grammar::parse( "192.168.0.1", ipv4_address_rule );
0031     @endcode
0032 
0033     @par BNF
0034     @code
0035     IPv4address = dec-octet "." dec-octet "." dec-octet "." dec-octet
0036 
0037     dec-octet   = DIGIT                 ; 0-9
0038                 / %x31-39 DIGIT         ; 10-99
0039                 / "1" 2DIGIT            ; 100-199
0040                 / "2" %x30-34 DIGIT     ; 200-249
0041                 / "25" %x30-35          ; 250-255
0042     @endcode
0043 
0044     @par Specification
0045     @li <a href="https://en.wikipedia.org/wiki/IPv4"
0046         >IPv4 (Wikipedia)</a>
0047     @li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2"
0048         >3.2.2. Host (rfc3986)</a>
0049 
0050     @see
0051         @ref ipv4_address,
0052         @ref parse_ipv4_address,
0053         @ref grammar::parse.
0054 */
0055 #ifdef BOOST_URL_DOCS
0056 constexpr __implementation_defined__ ipv4_address_rule;
0057 #else
0058 struct ipv4_address_rule_t
0059 {
0060     using value_type =
0061         ipv4_address;
0062 
0063     BOOST_URL_DECL
0064     auto
0065     parse(
0066         char const*& it,
0067         char const* end
0068             ) const noexcept ->
0069         system::result<ipv4_address>;
0070 };
0071 
0072 constexpr ipv4_address_rule_t ipv4_address_rule{};
0073 #endif
0074 
0075 } // urls
0076 } // boost
0077 
0078 #endif