23namespace http_field_parsers
193 debug_printer( std::string v ) noexcept : m_tag{ std::move(v) } {}
195 template<
typename Target_Type >
197 std::optional< parse_error_t >
200 std::cout <<
"*** debug_print: " << m_tag << std::endl;
488 using host_value_t = std::variant< reg_name_t, ipv4_address_t, ipv6_address_t >;
496 std::optional<std::uint16_t>
port;
507 using namespace host_details;
575 m_to <<
'[' << n.
v <<
']';
582 to <<
':' << *(
rhv.port) << std::endl;
Utilities for parsing values of http-fields.
The class that implements "input stream".
A template for producer of charachers that satisfy some predicate.
constexpr bool is_digit(const char ch) noexcept
Is a character a decimal digit?
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 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 sequence(Clauses &&... clauses)
A factory function to create a sequence of subclauses.
auto pct_encoded_symbols_p()
A producer that extract a sequence of symbols represented a percent-encoded character.
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.
constexpr bool is_alpha(const char ch) noexcept
Is a character an ALPHA?
std::ostream & operator<<(std::ostream &to, const authorization_value_t::param_value_t &v)
run_on_this_thread_settings_t< Traits > on_this_thread()
A special marker for the case when http_server must be run on the context of the current thread.
std::string_view string_view_t
nonstd::expected< T, E > expected_t
Stuff related to percent-encoded symbols.
A special base class to be used with clauses.
A special consumer that inserts an extracted sequence of symbols into the result string.
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.