ゴミ箱
Classes | Public Types | Public Member Functions | List of all members
boost::beast::http::param_list Class Reference

#include <rfc7230.hpp>

Classes

class  const_iterator
 

Public Types

using value_type = std::pair< string_view, string_view >
 

Public Member Functions

 param_list ()=default
 Default constructor. More...
 
 param_list (string_view s)
 
const_iterator begin () const
 Return a const iterator to the beginning of the list. More...
 
const_iterator end () const
 Return a const iterator to the end of the list. More...
 
const_iterator cbegin () const
 Return a const iterator to the beginning of the list. More...
 
const_iterator cend () const
 Return a const iterator to the end of the list. More...
 

Detailed Description

A list of parameters in an HTTP extension field value.

This container allows iteration of the parameter list in an HTTP extension. The parameter list is a series of name/value pairs with each pair starting with a semicolon. The value is optional.

If a parsing error is encountered while iterating the string, the behavior of the container will be as if a string containing only characters up to but excluding the first invalid character was used to construct the list.

BNF
param-list = *( OWS ";" OWS param )
param = token OWS [ "=" OWS ( token / quoted-string ) ]

To use this class, construct with the string to be parsed and then use begin and end, or range-for to iterate each item:

Example
for(auto const& param : param_list{";level=9;no_context_takeover;bits=15"})
{
std::cout << ";" << param.first;
if(! param.second.empty())
std::cout << "=" << param.second;
std::cout << "\n";
}

Member Typedef Documentation

The type of each element in the list.

The first string in the pair is the name of the parameter, and the second string in the pair is its value (which may be empty).

Constructor & Destructor Documentation

boost::beast::http::param_list::param_list ( )
default

Default constructor.

boost::beast::http::param_list::param_list ( string_view  s)
inlineexplicit

Construct a list.

Parameters
sA string containing the list contents. The string must remain valid for the lifetime of the container.

Member Function Documentation

auto boost::beast::http::param_list::begin ( ) const
inline

Return a const iterator to the beginning of the list.

auto boost::beast::http::param_list::cbegin ( ) const
inline

Return a const iterator to the beginning of the list.

auto boost::beast::http::param_list::cend ( ) const
inline

Return a const iterator to the end of the list.

auto boost::beast::http::param_list::end ( ) const
inline

Return a const iterator to the end of the list.


The documentation for this class was generated from the following files: