RESTinio
|
Tools for working with the value of Range HTTP-field. More...
#include <range.hpp>
Public Types | |
using | double_ended_range_t = range_details::double_ended_range_t< T > |
Value of range for the case where both ends of the range are defined. More... | |
using | open_ended_range_t = range_details::open_ended_range_t< T > |
Value of range for the case where only left border of the range is defined. More... | |
using | suffix_length_t = range_details::suffix_length_t< T > |
Value of range for the case where only length of range's suffix is defined. More... | |
using | byte_range_spec_t = range_details::byte_range_spec_t< T > |
Variant type for all possible cases of specification for one range. More... | |
using | byte_ranges_specifier_t = range_details::byte_ranges_specifier_t< T > |
A struct that holds a container of byte_range_specs. More... | |
using | other_ranges_specifier_t = range_details::other_ranges_specifier_t |
A description of a range value of units those are not "bytes". More... | |
using | value_t = range_details::value_t< T > |
Variant type for holding parsed value of Range HTTP-field. More... | |
Static Public Member Functions | |
static RESTINIO_NODISCARD auto | make_parser () |
A factory function for a parser of Range value. More... | |
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. More... | |
Public Attributes | |
value_t | value |
Tools for working with the value of Range HTTP-field.
This struct represents parsed value of HTTP-field Range (see https://tools.ietf.org/html/rfc7233#section-3.1 and https://tools.ietf.org/html/rfc7233#section-2):
Range = byte-ranges-specifier / other-ranges-specifier byte-ranges-specifier = bytes-unit "=" byte-range-set byte-range-set = 1#( byte-range-spec / suffix-byte-range-spec ) byte-range-spec = first-byte-pos "-" [ last-byte-pos ] first-byte-pos = 1*DIGIT last-byte-pos = 1*DIGIT suffix-byte-range-spec = "-" suffix-length suffix-length = 1*DIGIT other-ranges-specifier = other-range-unit "=" other-range-set other-range-set = 1*VCHAR
T | integer type for holding parsed values for byte-ranges-specifier. It is expected to be type like int, unsigned int, long, unsigned long, std::uint64_t, std::uint_least64_t and so on. |
using restinio::http_field_parsers::range_value_t< T >::byte_range_spec_t = range_details::byte_range_spec_t<T> |
using restinio::http_field_parsers::range_value_t< T >::byte_ranges_specifier_t = range_details::byte_ranges_specifier_t<T> |
A struct that holds a container of byte_range_specs.
Usage example:
using restinio::http_field_parsers::range_value_t< T >::double_ended_range_t = range_details::double_ended_range_t<T> |
Value of range for the case where both ends of the range are defined.
This type will be used if a range is defined such way:
bytes=1000-5000,6000-7000
Usage example:
using restinio::http_field_parsers::range_value_t< T >::open_ended_range_t = range_details::open_ended_range_t<T> |
Value of range for the case where only left border of the range is defined.
This type will be used if a range is defined such way:
bytes=1000-
Usage example:
using restinio::http_field_parsers::range_value_t< T >::other_ranges_specifier_t = range_details::other_ranges_specifier_t |
A description of a range value of units those are not "bytes".
This type will be used for values like:
x-megabytes=1-45,450-1300
Please note that other_ranges_specifier_t::range_set contains the raw value. E.g. for the example above range_set will hold "1-45,450-1300".
using restinio::http_field_parsers::range_value_t< T >::suffix_length_t = range_details::suffix_length_t<T> |
Value of range for the case where only length of range's suffix is defined.
This type will be used if a range is defined such way:
bytes=-450
Usage example:
using restinio::http_field_parsers::range_value_t< T >::value_t = range_details::value_t<T> |
|
inlinestatic |
|
inlinestatic |
value_t restinio::http_field_parsers::range_value_t< T >::value |