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_USERINFO_RULE_HPP
0011 #define BOOST_URL_RFC_DETAIL_USERINFO_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 
0017 namespace boost {
0018 namespace urls {
0019 namespace detail {
0020 
0021 /** Rule for userinfo
0022 
0023     @par BNF
0024     @code
0025     userinfo    = user [ ":" [ password ] ]
0026 
0027     user        = *( unreserved / pct-encoded / sub-delims )
0028     password    = *( unreserved / pct-encoded / sub-delims / ":" )
0029     @endcode
0030 
0031     @par Specification
0032     <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1"
0033         >3.2.1. User Information (3986)</a>
0034 */
0035 struct userinfo_rule_t
0036 {
0037     struct value_type
0038     {
0039         pct_string_view user;
0040         pct_string_view password;
0041         bool has_password = false;
0042     };
0043 
0044     auto
0045     parse(
0046         char const*& it,
0047         char const* end
0048             ) const noexcept ->
0049         system::result<value_type>;
0050 };
0051 
0052 constexpr userinfo_rule_t userinfo_rule{};
0053 
0054 } // detail
0055 } // urls
0056 } // boost
0057 
0058 #endif