RESTinio

Classes | Typedefs | Functions
restinio::http_field_parsers::range_details Namespace Reference

## Classes
struct | byte_ranges_specifier_t
| A struct that holds a container of byte_range_specs. More...
struct | double_ended_range_t
| Value of range for the case where both ends of the range are defined. More...
struct | open_ended_range_t
| Value of range for the case where only left border of the range is defined. More...
struct | other_ranges_specifier_t
| A description of a range value of units those are not "bytes". More...
struct | suffix_length_t
| Value of range for the case where only length of range's suffix is defined. More...

## Typedefs
template<typename T >
using | byte_range_spec_t = variant_t< double_ended_range_t< T >, open_ended_range_t< T >, suffix_length_t< T > >
| Variant type for all possible cases of specification for one range. More...
template<typename T >
using | value_t = variant_t< byte_ranges_specifier_t< T >, other_ranges_specifier_t >
| Variant type for holding parsed value of Range HTTP-field. More...

## Functions
template<typename T >
RESTINIO_NODISCARD auto | make_byte_range_spec_parser ()
| Factory for creation of a parser for byte_range_spec values. More...
RESTINIO_NODISCARD auto | make_bytes_prefix_parser ()
| Factory for a parser of 'bytes=' prefix. More...
template<typename T >
RESTINIO_NODISCARD auto | make_byte_ranges_specifier_parser ()
| Factory for creation of a parser for byte_ranges_specifier values. More...
RESTINIO_NODISCARD auto | make_other_ranges_specifier_parser ()
| Factory for creation of a parser for other_ranges_specifier values. More...

## Typedef Documentation

## ◆ byte_range_spec_t

template<typename T >

using restinio::http_field_parsers::range_details::byte_range_spec_t = typedef variant_t< double_ended_range_t<T>, open_ended_range_t<T>, suffix_length_t<T> >

Variant type for all possible cases of specification for one range.

Since
  v.0.6.2

Definition at line 85 of file range.hpp.

## ◆ value_t

template<typename T >

using restinio::http_field_parsers::range_details::value_t = typedef variant_t< byte_ranges_specifier_t<T>, other_ranges_specifier_t >

Variant type for holding parsed value of Range HTTP-field.

Since
  v.0.6.2

Definition at line 126 of file range.hpp.

## Function Documentation

## ◆ make_byte_range_spec_parser()

template<typename T >

RESTINIO_NODISCARD auto restinio::http_field_parsers::range_details::make_byte_range_spec_parser | ( |  | ) |

Factory for creation of a parser for byte_range_spec values.

Creates a parser for the following rule:

    byte-range-spec = byte-range / suffix-byte-range-spec

    byte-range      = 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

The parser returned produces value of byte_range_spec_t<T>.

Since
  v.0.6.2

Definition at line 152 of file range.hpp.

## ◆ make_byte_ranges_specifier_parser()

template<typename T >

RESTINIO_NODISCARD auto restinio::http_field_parsers::range_details::make_byte_ranges_specifier_parser | ( |  | ) |

Factory for creation of a parser for byte_ranges_specifier values.

Creates a parser for the following rule:

    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

The parser returned produces value of byte_ranges_specifier_t<T>.

Since
  v.0.6.2

Definition at line 211 of file range.hpp.

## ◆ make_bytes_prefix_parser()

RESTINIO_NODISCARD auto restinio::http_field_parsers::range_details::make_bytes_prefix_parser | ( |  | ) |
| inline

Factory for a parser of 'bytes=' prefix.

Since
  v.0.6.2

Definition at line 184 of file range.hpp.

## ◆ make_other_ranges_specifier_parser()

RESTINIO_NODISCARD auto restinio::http_field_parsers::range_details::make_other_ranges_specifier_parser | ( |  | ) |
| inline

Factory for creation of a parser for other_ranges_specifier values.

Creates a parser for the following rule:

    other-ranges-specifier = other-range-unit "=" other-range-set
    other-range-set = 1*VCHAR

The parser returned produces value of other_ranges_specifier_t.

Since
  v.0.6.2

Definition at line 239 of file range.hpp.