Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 10:02:03

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_GRAMMAR_DEC_OCTET_RULE_HPP
0011 #define BOOST_URL_GRAMMAR_DEC_OCTET_RULE_HPP
0012 
0013 #include <boost/url/detail/config.hpp>
0014 #include <boost/url/error_types.hpp>
0015 
0016 namespace boost {
0017 namespace urls {
0018 namespace grammar {
0019 
0020 /** Match a decimal octet
0021 
0022     A decimal octet is precise way of
0023     saying a number from 0 to 255. These
0024     are commonly used in IPv4 addresses.
0025 
0026     @par Value Type
0027     @code
0028     using value_type = unsigned char;
0029     @endcode
0030 
0031     @par Example
0032     Rules are used with the function @ref parse.
0033     @code
0034     system::result< unsigned char > rv = parse( "255", dec_octet_rule );
0035     @endcode
0036 
0037     @par BNF
0038     @code
0039     dec-octet   = DIGIT                 ; 0-9
0040                 / %x31-39 DIGIT         ; 10-99
0041                 / "1" 2DIGIT            ; 100-199
0042                 / "2" %x30-34 DIGIT     ; 200-249
0043                 / "25" %x30-35          ; 250-255
0044     @endcode
0045 
0046     @par Specification
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 parse.
0052 */
0053 #ifdef BOOST_URL_DOCS
0054 constexpr __implementation_defined__ dec_octet_rule;
0055 #else
0056 struct dec_octet_rule_t
0057 {
0058     using value_type = unsigned char;
0059 
0060     BOOST_URL_DECL
0061     auto
0062     parse(
0063         char const*& it,
0064         char const* end
0065             ) const noexcept ->
0066         system::result<value_type>;
0067 };
0068 
0069 constexpr dec_octet_rule_t dec_octet_rule{};
0070 #endif
0071 
0072 } // grammar
0073 } // urls
0074 } // boost
0075 
0076 #endif