50 return hfp_impl::is_alpha(actual)
51 || hfp_impl::is_digit(actual)
74 return ep_impl::symbol_producer_template_t< unreserved_predicate_t >{};
123 return ep_impl::symbol_producer_template_t< sub_delims_predicate_t >{};
189struct debug_printer :
public ep_impl::clause_tag
193 debug_printer( std::string v ) noexcept : m_tag{ std::move(v) } {}
195 template<
typename Target_Type >
197 std::optional< parse_error_t >
198 try_process( ep_impl::source_t & from, Target_Type & )
200 std::cout <<
"*** debug_print: " << m_tag << std::endl;
240 const auto h16_with_colon =
sequence(
255 const auto double_colon =
262 repeat( 6u, 6u, h16_with_colon ),
267 repeat( 5u, 5u, h16_with_colon ),
273 repeat( 4u, 4u, h16_with_colon ),
278 repeat( 0u, 1u, h16_with_colon ),
282 repeat( 3u, 3u, h16_with_colon ),
287 repeat( 0u, 2u, h16_with_colon ),
291 repeat( 2u, 2u, h16_with_colon ),
296 repeat( 0u, 3u, h16_with_colon ),
305 repeat( 0u, 4u, h16_with_colon ),
313 repeat( 0u, 5u, h16_with_colon ),
321 repeat( 0u, 6u, h16_with_colon ),
359 hfp_details::pct_encoded_symbols_p()
360 >> hfp_details::pct_encoded_symbols_consumer_t{},
394 explicit reg_name_t( std::string val ) noexcept :
v{ std::move(val) } {}
488 using host_value_t = std::variant< reg_name_t, ipv4_address_t, ipv6_address_t >;
496 std::optional<std::uint16_t>
port;
575 m_to <<
'[' << n.
v <<
']';
579 visit( host_dumper_t{ to }, rhv.
host );
582 to <<
':' << *(rhv.
port) << std::endl;
Utilities for parsing values of http-fields.
auto digit_p() noexcept
A factory function to create a digit_producer.
auto to_container()
A factory function to create a to_container_consumer.
auto symbol(char expected) noexcept
A factory function to create a clause that expects the speficied symbol, extracts it and then skips i...
expected_t< typename Producer::result_type, parse_error_t > try_parse(string_view_t from, Producer producer)
Perform the parsing of the specified content by using specified value producer.
auto as_result() noexcept
A factory function to create a as_result_consumer.
auto maybe(Clauses &&... clauses)
A factory function to create an optional clause.
auto just(T value) noexcept(noexcept(impl::just_value_transformer_t< T >{value}))
A special transformer that replaces the produced value by a value specified by a user.
auto symbol_p(char expected) noexcept
A factory function to create a symbol_producer.
auto to_lower() noexcept
A factory function to create a to_lower_transformer.
auto alternatives(Clauses &&... clauses)
A factory function to create an alternatives clause.
auto convert(Converter &&converter)
A factory function to create convert_transformer.
auto produce(Clauses &&... clauses)
A factory function to create a producer that creates an instance of the target type by using specifie...
auto not_clause(Clauses &&... clauses)
A factory function to create a not_clause.
auto symbol_from_range_p(char left, char right) noexcept
A factory function to create a symbol_from_range_producer.
constexpr std::size_t N
A special marker that means infinite repetitions.
auto hexdigit_p() noexcept
A factory function to create a hexdigit_producer.
auto exact_p(string_view_t fragment)
A factory function that creates an instance of exact_fragment_producer.
auto repeat(std::size_t min_occurences, std::size_t max_occurences, Clauses &&... clauses)
A factory function to create repetitor of subclauses.
auto non_negative_decimal_number_p() noexcept
A factory function to create a non_negative_decimal_number_producer.
auto sequence(Clauses &&... clauses)
A factory function to create a sequence of subclauses.
auto reg_name_p()
A factory for producer of reg-name value.
auto ipv4_address_p()
A factory for producer of IPv4address value.
auto sub_delims_symbol_p()
A factory for producer that extracts sub-delims symbols.
auto ipv6_address_p()
A factory for producer of ipv6_address value.
auto unreserved_symbol_p()
A factory for producer that extracts unreserved symbols.
std::ostream & operator<<(std::ostream &to, const authorization_value_t::param_value_t &v)
std::string_view string_view_t
nonstd::expected< T, E > expected_t
Stuff related to percent-encoded symbols.
A preducate for symbol_producer_template that checks that a symbol is sub-delims symbol from RCF3986.
bool operator()(const char actual) const noexcept
A preducate for symbol_producer_template that checks that a symbol is unreserved symbol from RCF3986.
bool operator()(const char actual) const noexcept
friend bool operator==(const ipv4_address_t &a, const ipv4_address_t &b) noexcept
static ipv4_address_t from_string(std::string v) noexcept
friend bool operator!=(const ipv4_address_t &a, const ipv4_address_t &b) noexcept
ipv4_address_t(std::string val) noexcept
friend bool operator<(const ipv4_address_t &a, const ipv4_address_t &b) noexcept
friend bool operator!=(const ipv6_address_t &a, const ipv6_address_t &b) noexcept
friend bool operator==(const ipv6_address_t &a, const ipv6_address_t &b) noexcept
friend bool operator<(const ipv6_address_t &a, const ipv6_address_t &b) noexcept
static ipv6_address_t from_string(std::string v) noexcept
ipv6_address_t(std::string val) noexcept
friend bool operator<(const reg_name_t &a, const reg_name_t &b) noexcept
static reg_name_t from_string(std::string v) noexcept
friend bool operator!=(const reg_name_t &a, const reg_name_t &b) noexcept
reg_name_t(std::string val) noexcept
friend bool operator==(const reg_name_t &a, const reg_name_t &b) noexcept
Tools for working with the raw value of Host HTTP-field.
std::optional< std::uint16_t > port
Optional port value.
std::variant< reg_name_t, ipv4_address_t, ipv6_address_t > host_value_t
static auto make_parser()
A factory function for a parser of Host value.
static expected_t< raw_host_value_t, restinio::easy_parser::parse_error_t > try_parse(string_view_t what)
An attempt to parse Host HTTP-field.