21namespace http_field_parsers
62 std::vector< tail_item_t >
tail;
73 auto product_producer = produce< product_t >(
81 return produce< user_agent_value_t >(
83 produce< std::vector< tail_item_t > >(
Utilities for parsing values of http-fields.
#define RESTINIO_NODISCARD
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 produce(Clauses &&... clauses)
A factory function to create a producer that creates an instance of the target type by using specifie...
RESTINIO_NODISCARD auto space() noexcept
A factory function to create a clause that expects a space, extracts it and then skips it.
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.
constexpr std::size_t N
A special marker that means infinite repetitions.
RESTINIO_NODISCARD auto to_container()
A factory function to create a to_container_consumer.
RESTINIO_NODISCARD auto alternatives(Clauses &&... clauses)
A factory function to create an alternatives clause.
RESTINIO_NODISCARD auto comment_p()
A factory for producer of comment token.
RESTINIO_NODISCARD auto ows() noexcept
A factory function to create an OWS clause.
RESTINIO_NODISCARD auto token_p() noexcept
A factory function to create a token_producer.
nonstd::string_view string_view_t
nonstd::expected< T, E > expected_t
A type for holding an info about a product.
restinio::optional_t< std::string > product_version
Tools for working with the value of User-Agent HTTP-field.
static RESTINIO_NODISCARD expected_t< user_agent_value_t, restinio::easy_parser::parse_error_t > try_parse(string_view_t what)
An attempt to parse User-Agent HTTP-field.
std::vector< tail_item_t > tail
static RESTINIO_NODISCARD auto make_parser()
A factory function for a parser of User-Agent value.