21namespace http_field_parsers
24namespace range_details
98 std::vector< byte_range_spec_t<T> >
ranges;
125template<
typename T >
149template<
typename T >
154 return produce< byte_range_spec_t<T> >(
157 non_negative_decimal_number_p<T>()
160 non_negative_decimal_number_p<T>()
164 non_negative_decimal_number_p<T>()
170 non_negative_decimal_number_p<T>()
208template<
typename T >
213 return produce< byte_ranges_specifier_t<T> >(
218 make_byte_range_spec_parser<T>()
241 return produce< other_ranges_specifier_t >(
245 produce< std::string >(
285template<
typename T >
455 using namespace range_details;
457 return produce< range_value_t >(
459 make_byte_ranges_specifier_parser<T>() >>
Utilities for parsing values of http-fields.
#define RESTINIO_NODISCARD
RESTINIO_NODISCARD auto force_only_this_alternative(Clauses &&... clauses)
An alternative that should be parsed correctly or the parsing of the whole alternatives clause should...
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 auto produce(Clauses &&... clauses)
A factory function to create a producer that creates an instance of the target type by using specifie...
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 exact(string_view_t fragment)
A factory function that creates an instance of exact_fragment clause.
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 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 make_byte_range_spec_parser()
Factory for creation of a parser for byte_range_spec values.
RESTINIO_NODISCARD auto make_byte_ranges_specifier_parser()
Factory for creation of a parser for byte_ranges_specifier values.
RESTINIO_NODISCARD auto make_other_ranges_specifier_parser()
Factory for creation of a parser for other_ranges_specifier values.
RESTINIO_NODISCARD auto make_bytes_prefix_parser()
Factory for a parser of 'bytes=' prefix.
RESTINIO_NODISCARD auto non_empty_comma_separated_list_p(Element_Producer element)
A factory for a producer that handles non-empty list of comma-separated values.
RESTINIO_NODISCARD auto vchar_symbol_p()
A factory for producer of VCHAR symbols.
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 struct that holds a container of byte_range_specs.
std::vector< byte_range_spec_t< T > > ranges
Value of range for the case where both ends of the range are defined.
Value of range for the case where only left border of the range is defined.
A description of a range value of units those are not "bytes".
Value of range for the case where only length of range's suffix is defined.
Tools for working with the value of Range HTTP-field.
static RESTINIO_NODISCARD expected_t< range_value_t, restinio::easy_parser::parse_error_t > try_parse(string_view_t what)
An attempt to parse Range HTTP-field.
static RESTINIO_NODISCARD auto make_parser()
A factory function for a parser of Range value.