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_RELATIVE_PART_RULE_HPP
0011 #define BOOST_URL_RFC_DETAIL_RELATIVE_PART_RULE_HPP
0012 
0013 #include <boost/url/detail/config.hpp>
0014 #include <boost/url/error_types.hpp>
0015 #include <boost/url/pct_string_view.hpp>
0016 #include <boost/url/rfc/authority_rule.hpp>
0017 #include <cstdlib>
0018 
0019 namespace boost {
0020 namespace urls {
0021 namespace detail {
0022 
0023 /** Rule for relative-part
0024 
0025     @par BNF
0026     @code
0027     relative-part = "//" authority path-abempty
0028                   / path-absolute
0029                   / path-noscheme
0030                   / path-abempty
0031                   / path-empty
0032     @endcode
0033 
0034     @par Specification
0035     @li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-4.2"
0036         >4.2. Relative Reference (rfc3986)</a>
0037     @li <a href="https://www.rfc-editor.org/errata/eid5428"
0038         >Errata ID: 5428 (rfc3986)</a>
0039 
0040     @see
0041         @ref authority_rule.
0042 */
0043 struct relative_part_rule_t
0044 {
0045     struct value_type
0046     {
0047         authority_view authority;
0048         pct_string_view path;
0049         std::size_t segment_count = 0;
0050         bool has_authority = false;
0051     };
0052 
0053     auto
0054     parse(
0055         char const*& it,
0056         char const* end
0057             ) const noexcept ->
0058         system::result<value_type>;
0059 };
0060 
0061 constexpr relative_part_rule_t relative_part_rule{};
0062 
0063 } // detail
0064 } // urls
0065 } // boost
0066 
0067 #endif