RESTinio

Classes | Public Types | Static Public Member Functions | Public Attributes | List of all members
restinio::http_field_parsers::accept_value_t Struct Reference

Tools for working with the value of Accept HTTP-field. More...

`#include <accept.hpp>`

## Classes
struct | item_t

## Public Types
using | item_container_t = std::vector< item_t >

## Static Public Member Functions
static RESTINIO_NODISCARD auto | make_parser ()
| A factory function for a parser of Accept value. More...
static RESTINIO_NODISCARD expected_t< accept_value_t, restinio::easy_parser::parse_error_t > | try_parse (string_view_t what)
| An attempt to parse Accept HTTP-field. More...

## Public Attributes
item_container_t | items

## Detailed Description

Tools for working with the value of Accept HTTP-field.

This struct represents parsed value of HTTP-field Accept (see https://tools.ietf.org/html/rfc7231#section-5.3.2):

         Accept = #( media-range [ accept-params ] )

         media-range    = ( "*" "/" "*"
                          / ( type "/" "*" )
                          / ( type "/" subtype )
                          ) *( OWS ";" OWS parameter )
         accept-params  = weight *( accept-ext )
         accept-ext = OWS ";" OWS token [ "=" ( token / quoted-string ) ]

         weight = OWS ";" OWS "q=" qvalue
         qvalue = ( "0" [ "." 0*3DIGIT ] )
                / ( "1" [ "." 0*3("0") ] )

Note
  Parameter names are converted to lower case during the parsing. Parameter values are left as they are.

Since
  v.0.6.1

Definition at line 51 of file accept.hpp.

## Member Typedef Documentation

## ◆ item_container_t

using restinio::http_field_parsers::accept_value_t::item_container_t = std::vector< item_t >

Definition at line 64 of file accept.hpp.

## Member Function Documentation

## ◆ make_parser()

static RESTINIO_NODISCARD auto restinio::http_field_parsers::accept_value_t::make_parser | ( |  | ) |
| inline static

A factory function for a parser of Accept value.

Since
  v.0.6.1

Definition at line 75 of file accept.hpp.

## ◆ try_parse()

static RESTINIO_NODISCARD expected_t< accept_value_t, restinio::easy_parser::parse_error_t > restinio::http_field_parsers::accept_value_t::try_parse | ( | string_view_t | what | ) |
| inline static

An attempt to parse Accept HTTP-field.

Since
  v.0.6.1

Definition at line 99 of file accept.hpp.

## Member Data Documentation

## ◆ items

item_container_t restinio::http_field_parsers::accept_value_t::items

Definition at line 66 of file accept.hpp.

The documentation for this struct was generated from the following file:

- restinio/helpers/http_field_parsers/accept.hpp