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_HIER_PART_RULE_HPP
0011 #define BOOST_URL_RFC_DETAIL_HIER_PART_RULE_HPP
0012 
0013 #include <boost/url/detail/config.hpp>
0014 #include <boost/url/pct_string_view.hpp>
0015 #include <boost/url/rfc/authority_rule.hpp>
0016 #include <cstdlib>
0017 
0018 namespace boost {
0019 namespace urls {
0020 namespace detail {
0021 
0022 /** Rule for hier-part
0023 
0024     @par BNF
0025     @code
0026     hier-part     = "//" authority path-abempty
0027                   / path-absolute
0028                   / path-rootless
0029                   / path-empty
0030     @endcode
0031 
0032     @par Specification
0033     @li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3"
0034         >3. Syntax Components (rfc3986)</a>
0035 */
0036 struct hier_part_rule_t
0037 {
0038     struct value_type
0039     {
0040         authority_view authority;
0041         pct_string_view path;
0042         std::size_t segment_count = 0;
0043         bool has_authority = false;
0044     };
0045 
0046     BOOST_URL_DECL
0047     auto
0048     parse(
0049         char const*& it,
0050         char const* const end
0051             ) const noexcept ->
0052         system::result<value_type>;
0053 };
0054 
0055 constexpr hier_part_rule_t hier_part_rule{};
0056 
0057 } // detail
0058 } // urls
0059 } // boost
0060 
0061 #endif