RESTinio
Loading...
Searching...
No Matches
restinio::http_field_parsers::user_agent_value_t Struct Reference

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

#include <user-agent.hpp>

Classes

struct  product_t
 A type for holding an info about a product. More...

Public Types

using tail_item_t = std::variant< product_t, std::string >
 A type for holding an info about a product or a comment.

Static Public Member Functions

static auto make_parser ()
 A factory function for a parser of User-Agent value.
static expected_t< user_agent_value_t, restinio::easy_parser::parse_error_ttry_parse (string_view_t what)
 An attempt to parse User-Agent HTTP-field.

Public Attributes

product_t product
std::vector< tail_item_ttail

Detailed Description

Tools for working with the value of User-Agent HTTP-field.

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

     User-Agent = product *( RWS ( product / comment ) )

     product         = token ["/" product-version]
     product-version = token
Since
v.0.6.4

Definition at line 41 of file user-agent.hpp.

Member Typedef Documentation

◆ tail_item_t

A type for holding an info about a product or a comment.

Since
v.0.6.4

Definition at line 59 of file user-agent.hpp.

Member Function Documentation

◆ make_parser()

auto restinio::http_field_parsers::user_agent_value_t::make_parser ( )
inlinestaticnodiscard

A factory function for a parser of User-Agent value.

Since
v.0.6.4

Definition at line 71 of file user-agent.hpp.

◆ try_parse()

expected_t< user_agent_value_t, restinio::easy_parser::parse_error_t > restinio::http_field_parsers::user_agent_value_t::try_parse ( string_view_t what)
inlinestaticnodiscard

An attempt to parse User-Agent HTTP-field.

Since
v.0.6.4

Definition at line 103 of file user-agent.hpp.

Member Data Documentation

◆ product

product_t restinio::http_field_parsers::user_agent_value_t::product

Definition at line 61 of file user-agent.hpp.

◆ tail

std::vector< tail_item_t > restinio::http_field_parsers::user_agent_value_t::tail

Definition at line 62 of file user-agent.hpp.


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