23namespace http_field_parsers
151 const auto dec_octet = produce< std::string >(
176 return produce< std::string >(
193 debug_printer( std::string v ) noexcept : m_tag{
std::move(v) } {}
195 template<
typename Target_Type >
197 optional_t< parse_error_t >
200 std::cout <<
"*** debug_print: " << m_tag << std::endl;
237 const auto h16 = produce< std::string >(
240 const auto h16_with_colon =
sequence(
245 const auto ls32 = produce< std::string >(
255 const auto double_colon =
259 return produce< std::string >(
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 ),
355 return produce< std::string >(
507 using namespace host_details;
509 return produce< raw_host_value_t >(
510 produce< host_value_t >(
513 produce< ipv6_address_t >(
522 produce< ipv4_address_t >(
528 produce< reg_name_t >(
537 non_negative_decimal_number_p< std::uint16_t >()
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.
#define RESTINIO_NODISCARD
const nullopt_t nullopt((nullopt_t::init()))
R visit(const Visitor &v, V1 const &arg1)
RESTINIO_NODISCARD constexpr bool is_digit(const char ch) noexcept
Is a character a decimal digit?
RESTINIO_NODISCARD auto symbol_from_range_p(char left, char right) noexcept
A factory function to create a symbol_from_range_producer.
RESTINIO_NODISCARD auto maybe(Clauses &&... clauses)
A factory function to create an optional clause.
RESTINIO_NODISCARD auto symbol(char expected) noexcept
A factory function to create a clause that expects the speficied symbol, extracts it and then skips i...
RESTINIO_NODISCARD auto sequence(Clauses &&... clauses)
A factory function to create a sequence of subclauses.
RESTINIO_NODISCARD 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.
RESTINIO_NODISCARD auto repeat(std::size_t min_occurences, std::size_t max_occurences, Clauses &&... clauses)
A factory function to create repetitor of subclauses.
RESTINIO_NODISCARD auto digit_p() noexcept
A factory function to create a digit_producer.
RESTINIO_NODISCARD auto exact_p(string_view_t fragment)
A factory function that creates an instance of exact_fragment_producer.
RESTINIO_NODISCARD auto as_result() noexcept
A factory function to create a as_result_consumer.
constexpr std::size_t N
A special marker that means infinite repetitions.
RESTINIO_NODISCARD auto hexdigit_p() noexcept
A factory function to create a hexdigit_producer.
RESTINIO_NODISCARD auto to_container()
A factory function to create a to_container_consumer.
RESTINIO_NODISCARD auto symbol_p(char expected) noexcept
A factory function to create a symbol_producer.
RESTINIO_NODISCARD auto not_clause(Clauses &&... clauses)
A factory function to create a not_clause.
RESTINIO_NODISCARD auto to_lower() noexcept
A factory function to create a to_lower_transformer.
RESTINIO_NODISCARD 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.
RESTINIO_NODISCARD auto alternatives(Clauses &&... clauses)
A factory function to create an alternatives clause.
RESTINIO_NODISCARD auto convert(Converter &&converter)
A factory function to create convert_transformer.
RESTINIO_NODISCARD auto pct_encoded_symbols_p()
A producer that extract a sequence of symbols represented a percent-encoded character.
RESTINIO_NODISCARD auto reg_name_p()
A factory for producer of reg-name value.
RESTINIO_NODISCARD auto ipv6_address_p()
A factory for producer of ipv6_address value.
RESTINIO_NODISCARD auto sub_delims_symbol_p()
A factory for producer that extracts sub-delims symbols.
RESTINIO_NODISCARD auto unreserved_symbol_p()
A factory for producer that extracts unreserved symbols.
RESTINIO_NODISCARD auto ipv4_address_p()
A factory for producer of IPv4address value.
RESTINIO_NODISCARD 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)
nonstd::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.
RESTINIO_NODISCARD bool operator()(const char actual) const noexcept
A preducate for symbol_producer_template that checks that a symbol is unreserved symbol from RCF3986.
RESTINIO_NODISCARD bool operator()(const char actual) const noexcept
friend bool operator==(const ipv4_address_t &a, const ipv4_address_t &b) noexcept
friend bool operator!=(const ipv4_address_t &a, const ipv4_address_t &b) noexcept
static RESTINIO_NODISCARD ipv4_address_t from_string(std::string v) 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
ipv6_address_t(std::string val) noexcept
static RESTINIO_NODISCARD ipv6_address_t from_string(std::string v) noexcept
friend bool operator<(const reg_name_t &a, const reg_name_t &b) noexcept
static RESTINIO_NODISCARD 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.
static RESTINIO_NODISCARD 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.
optional_t< std::uint16_t > port
Optional port value.
static RESTINIO_NODISCARD auto make_parser()
A factory function for a parser of Host value.