![]() |
|
|||
File indexing completed on 2025-09-18 09:07:55
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 namespace implementation_defined { 0059 struct ipv4_address_rule_t 0060 { 0061 using value_type = 0062 ipv4_address; 0063 0064 BOOST_URL_DECL 0065 auto 0066 parse( 0067 char const*& it, 0068 char const* end 0069 ) const noexcept -> 0070 system::result<ipv4_address>; 0071 }; 0072 } // implementation_defined 0073 0074 /** Rule for an IP version 4 style address 0075 0076 @par Value Type 0077 @code 0078 using value_type = ipv4_address; 0079 @endcode 0080 0081 @par Example 0082 Rules are used with the function @ref grammar::parse. 0083 @code 0084 system::result< ipv4_address > rv = grammar::parse( "192.168.0.1", ipv4_address_rule ); 0085 @endcode 0086 0087 @par BNF 0088 @code 0089 IPv4address = dec-octet "." dec-octet "." dec-octet "." dec-octet 0090 0091 dec-octet = DIGIT ; 0-9 0092 / %x31-39 DIGIT ; 10-99 0093 / "1" 2DIGIT ; 100-199 0094 / "2" %x30-34 DIGIT ; 200-249 0095 / "25" %x30-35 ; 250-255 0096 @endcode 0097 0098 @par Specification 0099 @li <a href="https://en.wikipedia.org/wiki/IPv4" 0100 >IPv4 (Wikipedia)</a> 0101 @li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2" 0102 >3.2.2. Host (rfc3986)</a> 0103 0104 @see 0105 @ref ipv4_address, 0106 @ref parse_ipv4_address, 0107 @ref grammar::parse. 0108 */ 0109 constexpr implementation_defined::ipv4_address_rule_t ipv4_address_rule{}; 0110 #endif 0111 0112 } // urls 0113 } // boost 0114 0115 #endif
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
![]() ![]() |