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_REG_NAME_RULE_HPP
0011 #define BOOST_URL_RFC_DETAIL_REG_NAME_RULE_HPP
0012 
0013 #include <boost/url/detail/config.hpp>
0014 #include <boost/url/rfc/pct_encoded_rule.hpp>
0015 #include <boost/url/rfc/sub_delim_chars.hpp>
0016 #include <boost/url/rfc/unreserved_chars.hpp>
0017 
0018 namespace boost {
0019 namespace urls {
0020 namespace detail {
0021 
0022 /*  VFALCO In theory we could enforce these
0023     additional requirements from errata 4942:
0024 
0025     Such a name consists of a sequence of domain
0026     labels separated by ".", each domain label
0027     starting and ending with an alphanumeric character
0028     and possibly also containing "-" characters.  The
0029     rightmost domain label of a fully qualified domain
0030     name in DNS may be followed by a single "." and
0031     should be if it is necessary to distinguish between
0032     the complete domain name and some local domain.
0033 */
0034 
0035 /** Rule for reg-name
0036 
0037     @par BNF
0038     @code
0039     reg-name    = *( unreserved / pct-encoded / "-" / ".")
0040     @endcode
0041 
0042     @par Specification
0043     @li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2"
0044         >3.2.2. Host (rfc3986)</a>
0045     @li <a href="https://www.rfc-editor.org/errata/eid4942"
0046         >Errata ID: 4942</a>
0047 */
0048 constexpr auto reg_name_rule =
0049     pct_encoded_rule(unreserved_chars + sub_delim_chars);
0050 
0051 } // detail
0052 } // urls
0053 } // boost
0054 
0055 #endif