File indexing completed on 2025-01-18 09:53:28
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef BOOST_URL_RFC_PCT_ENCODED_RULE_HPP
0011 #define BOOST_URL_RFC_PCT_ENCODED_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/grammar/charset.hpp>
0017
0018 namespace boost {
0019 namespace urls {
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059
0060 #ifdef BOOST_URL_DOCS
0061
0062 template<class CharSet>
0063 constexpr
0064 __implementation_defined__
0065 pct_encoded_rule( CharSet const& cs ) noexcept;
0066
0067 #else
0068 template<class CharSet>
0069 struct pct_encoded_rule_t
0070 {
0071 using value_type = pct_string_view;
0072
0073 template<class CharSet_>
0074 friend
0075 constexpr
0076 auto
0077 pct_encoded_rule(
0078 CharSet_ const& cs) noexcept ->
0079 pct_encoded_rule_t<CharSet_>;
0080
0081 system::result<value_type>
0082 parse(
0083 char const*& it,
0084 char const* end) const noexcept;
0085
0086 private:
0087 constexpr
0088 pct_encoded_rule_t(
0089 CharSet const& cs) noexcept
0090 : cs_(cs)
0091 {
0092 }
0093
0094 CharSet cs_;
0095 };
0096
0097 template<class CharSet>
0098 constexpr
0099 auto
0100 pct_encoded_rule(
0101 CharSet const& cs) noexcept ->
0102 pct_encoded_rule_t<CharSet>
0103 {
0104
0105
0106
0107
0108 static_assert(
0109 grammar::is_charset<CharSet>::value,
0110 "CharSet requirements not met");
0111
0112 return pct_encoded_rule_t<CharSet>(cs);
0113 }
0114
0115 #endif
0116
0117 }
0118 }
0119
0120 #include <boost/url/rfc/impl/pct_encoded_rule.hpp>
0121
0122 #endif