Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-18 09:07:55

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_URI_REFERENCE_RULE_HPP
0011 #define BOOST_URL_RFC_URI_REFERENCE_RULE_HPP
0012 
0013 #include <boost/url/detail/config.hpp>
0014 #include <boost/url/error_types.hpp>
0015 #include <boost/url/url_view.hpp>
0016 
0017 namespace boost {
0018 namespace urls {
0019 
0020 /** Rule for URI-reference
0021 
0022     @par Value Type
0023     @code
0024     using value_type = url_view;
0025     @endcode;
0026 
0027     @par Example
0028     Rules are used with the function @ref grammar::parse.
0029     @code
0030     system::result< url_view > rv = grammar::parse( "ws://echo.example.com/?name=boost#demo", uri_reference_rule );
0031     @endcode
0032 
0033     @par BNF
0034     @code
0035     URI-reference = URI / relative-ref
0036 
0037     URI           = scheme ":" hier-part [ "?" query ] [ "#" fragment ]
0038     relative-ref  = relative-part [ "?" query ] [ "#" fragment ]
0039     @endcode
0040 
0041     @par Specification
0042     @li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3"
0043         >3. Syntax Components (rfc3986)</a>
0044 
0045     @see
0046         @ref grammar::parse,
0047         @ref parse_uri_reference,
0048         @ref url_view.
0049 */
0050 #ifdef BOOST_URL_DOCS
0051 constexpr __implementation_defined__ uri_reference_rule{};
0052 #else
0053 namespace implementation_defined {
0054 struct uri_reference_rule_t
0055 {
0056     using value_type = url_view;
0057 
0058     BOOST_URL_DECL
0059     auto
0060     parse(
0061         char const*& it,
0062         char const* end
0063             ) const noexcept ->
0064     system::result<value_type>;
0065 };
0066 } // implementation_defined
0067 
0068 /** Rule for URI-reference
0069 
0070     @par Value Type
0071     @code
0072     using value_type = url_view;
0073     @endcode
0074 
0075     @par Example
0076     Rules are used with the function @ref grammar::parse.
0077     @code
0078     system::result< url_view > rv = grammar::parse( "ws://echo.example.com/?name=boost#demo", uri_reference_rule );
0079     @endcode
0080 
0081     @par BNF
0082     @code
0083     URI-reference = URI / relative-ref
0084 
0085     URI           = scheme ":" hier-part [ "?" query ] [ "#" fragment ]
0086     relative-ref  = relative-part [ "?" query ] [ "#" fragment ]
0087     @endcode
0088 
0089     @par Specification
0090     @li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3"
0091         >3. Syntax Components (rfc3986)</a>
0092 
0093     @see
0094         @ref grammar::parse,
0095         @ref parse_uri_reference,
0096         @ref url_view.
0097 */
0098 constexpr implementation_defined::uri_reference_rule_t uri_reference_rule{};
0099 #endif
0100 
0101 } // urls
0102 } // boost
0103 
0104 #endif