ゴミ箱
|
#include <fields.hpp>
Classes | |
struct | key_compare |
class | reader |
class | value_type |
The type of element used to represent a field. More... | |
Public Types | |
using | allocator_type = Allocator |
The type of allocator used. More... | |
using | const_iterator = typename list_t::const_iterator |
A constant iterator to the field sequence. More... | |
using | iterator = const_iterator |
A constant iterator to the field sequence. More... | |
Public Member Functions | |
~basic_fields () | |
Destructor. More... | |
basic_fields ()=default | |
Constructor. More... | |
basic_fields (Allocator const &alloc) | |
basic_fields (basic_fields &&) | |
basic_fields (basic_fields &&, Allocator const &alloc) | |
basic_fields (basic_fields const &) | |
Copy constructor. More... | |
basic_fields (basic_fields const &, Allocator const &alloc) | |
template<class OtherAlloc > | |
basic_fields (basic_fields< OtherAlloc > const &) | |
Copy constructor. More... | |
template<class OtherAlloc > | |
basic_fields (basic_fields< OtherAlloc > const &, Allocator const &alloc) | |
basic_fields & | operator= (basic_fields &&) |
basic_fields & | operator= (basic_fields const &) |
Copy assignment. More... | |
template<class OtherAlloc > | |
basic_fields & | operator= (basic_fields< OtherAlloc > const &) |
Copy assignment. More... | |
allocator_type | get_allocator () const |
Return a copy of the allocator associated with the container. More... | |
string_view | at (field name) const |
string_view | at (string_view name) const |
string_view | operator[] (field name) const |
string_view | operator[] (string_view name) const |
const_iterator | begin () const |
Return a const iterator to the beginning of the field sequence. More... | |
const_iterator | end () const |
Return a const iterator to the end of the field sequence. More... | |
const_iterator | cbegin () const |
Return a const iterator to the beginning of the field sequence. More... | |
const_iterator | cend () const |
Return a const iterator to the end of the field sequence. More... | |
void | insert (field name, string_param const &value) |
void | insert (string_view name, string_param const &value) |
void | insert (field name, string_view name_string, string_param const &value) |
void | set (field name, string_param const &value) |
void | set (string_view name, string_param const &value) |
const_iterator | erase (const_iterator pos) |
std::size_t | erase (field name) |
std::size_t | erase (string_view name) |
void | swap (basic_fields &other) |
Swap this container with another. More... | |
std::size_t | count (field name) const |
std::size_t | count (string_view name) const |
const_iterator | find (field name) const |
const_iterator | find (string_view name) const |
std::pair< const_iterator, const_iterator > | equal_range (field name) const |
std::pair< const_iterator, const_iterator > | equal_range (string_view name) const |
key_compare | key_comp () const |
Returns a copy of the key comparison function. More... | |
template<class OtherAlloc > | |
auto | operator= (basic_fields< OtherAlloc > const &other) -> basic_fields & |
Protected Member Functions | |
string_view | get_method_impl () const |
string_view | get_target_impl () const |
string_view | get_reason_impl () const |
bool | get_chunked_impl () const |
bool | get_keep_alive_impl (unsigned version) const |
void | set_method_impl (string_view s) |
void | set_target_impl (string_view s) |
void | set_reason_impl (string_view s) |
void | set_chunked_impl (bool value) |
void | set_content_length_impl (boost::optional< std::uint64_t > const &value) |
void | set_keep_alive_impl (unsigned version, bool keep_alive) |
Friends | |
class | fields_test |
template<class OtherAlloc > | |
class | basic_fields |
template<class Alloc > | |
void | swap (basic_fields< Alloc > &lhs, basic_fields< Alloc > &rhs) |
Swap two field containers. More... | |
A container for storing HTTP header fields.
This container is designed to store the field value pairs that make up the fields and trailers in an HTTP message. Objects of this type are iterable, with each element holding the field name and field value.
Field names are stored as-is, but comparisons are case-insensitive. The container behaves as a std::multiset
; there will be a separate value for each occurrence of the same field name. When the container is iterated the fields are presented in the order of insertion, with fields having the same name following each other consecutively.
Meets the requirements of Fields
Allocator | The allocator to use. This must meet the requirements of Allocator. |
using boost::beast::http::basic_fields< Allocator >::allocator_type = Allocator |
The type of allocator used.
using boost::beast::http::basic_fields< Allocator >::const_iterator = typename list_t::const_iterator |
A constant iterator to the field sequence.
using boost::beast::http::basic_fields< Allocator >::iterator = const_iterator |
A constant iterator to the field sequence.
boost::beast::http::basic_fields< Allocator >::~basic_fields | ( | ) |
Destructor.
|
default |
Constructor.
|
explicit |
Constructor.
alloc | The allocator to use. |
boost::beast::http::basic_fields< Allocator >::basic_fields | ( | basic_fields< Allocator > && | other | ) |
Move constructor.
The state of the moved-from object is as if constructed using the same allocator.
boost::beast::http::basic_fields< Allocator >::basic_fields | ( | basic_fields< Allocator > && | other, |
Allocator const & | alloc | ||
) |
Move constructor.
The state of the moved-from object is as if constructed using the same allocator.
alloc | The allocator to use. |
boost::beast::http::basic_fields< Allocator >::basic_fields | ( | basic_fields< Allocator > const & | other | ) |
Copy constructor.
boost::beast::http::basic_fields< Allocator >::basic_fields | ( | basic_fields< Allocator > const & | other, |
Allocator const & | alloc | ||
) |
Copy constructor.
alloc | The allocator to use. |
boost::beast::http::basic_fields< Allocator >::basic_fields | ( | basic_fields< OtherAlloc > const & | other | ) |
Copy constructor.
boost::beast::http::basic_fields< Allocator >::basic_fields | ( | basic_fields< OtherAlloc > const & | other, |
Allocator const & | alloc | ||
) |
Copy constructor.
alloc | The allocator to use. |
string_view boost::beast::http::basic_fields< Allocator >::at | ( | field | name | ) | const |
Returns the value for a field, or throws an exception.
If more than one field with the specified name exists, the first field defined by insertion order is returned.
name | The name of the field. |
std::out_of_range | if the field is not found. |
string_view boost::beast::http::basic_fields< Allocator >::at | ( | string_view | name | ) | const |
Returns the value for a field, or throws an exception.
If more than one field with the specified name exists, the first field defined by insertion order is returned.
name | The name of the field. |
std::out_of_range | if the field is not found. |
|
inline |
Return a const iterator to the beginning of the field sequence.
|
inline |
Return a const iterator to the beginning of the field sequence.
|
inline |
Return a const iterator to the end of the field sequence.
|
inline |
Return the number of fields with the specified name.
name | The field name. |
std::size_t boost::beast::http::basic_fields< Allocator >::count | ( | string_view | name | ) | const |
Return the number of fields with the specified name.
name | The field name. |
|
inline |
Return a const iterator to the end of the field sequence.
|
inline |
Returns a range of iterators to the fields with the specified name.
name | The field name. |
auto boost::beast::http::basic_fields< Allocator >::equal_range | ( | string_view | name | ) | const |
Returns a range of iterators to the fields with the specified name.
name | The field name. |
auto boost::beast::http::basic_fields< Allocator >::erase | ( | const_iterator | pos | ) |
Remove a field.
References and iterators to the erased elements are invalidated. Other references and iterators are not affected.
pos | An iterator to the element to remove. |
std::size_t boost::beast::http::basic_fields< Allocator >::erase | ( | field | name | ) |
Remove all fields with the specified name.
All fields with the same field name are erased from the container. References and iterators to the erased elements are invalidated. Other references and iterators are not affected.
name | The field name. |
std::size_t boost::beast::http::basic_fields< Allocator >::erase | ( | string_view | name | ) |
Remove all fields with the specified name.
All fields with the same field name are erased from the container. References and iterators to the erased elements are invalidated. Other references and iterators are not affected.
name | The field name. |
|
inline |
Returns an iterator to the case-insensitive matching field.
If more than one field with the specified name exists, the first field defined by insertion order is returned.
name | The field name. |
end()
if no match was found. auto boost::beast::http::basic_fields< Allocator >::find | ( | string_view | name | ) | const |
Returns an iterator to the case-insensitive matching field name.
If more than one field with the specified name exists, the first field defined by insertion order is returned.
name | The field name. |
end()
if no match was found.
|
inline |
Return a copy of the allocator associated with the container.
|
protected |
Returns the chunked Transfer-Encoding setting
|
protected |
Returns the keep-alive setting
|
inlineprotected |
Returns the request-method string.
|
inlineprotected |
Returns the response reason-phrase string.
|
inlineprotected |
Returns the request-target string.
|
inline |
Insert a field.
If one or more fields with the same name already exist, the new field will be inserted after the last field with the matching name, in serialization order.
name | The field name. |
value | The value of the field, as a string_param |
void boost::beast::http::basic_fields< Allocator >::insert | ( | string_view | name, |
string_param const & | value | ||
) |
Insert a field.
If one or more fields with the same name already exist, the new field will be inserted after the last field with the matching name, in serialization order.
name | The field name. |
value | The value of the field, as a string_param |
void boost::beast::http::basic_fields< Allocator >::insert | ( | field | name, |
string_view | name_string, | ||
string_param const & | value | ||
) |
Insert a field.
If one or more fields with the same name already exist, the new field will be inserted after the last field with the matching name, in serialization order.
name | The field name. |
name_string | The literal text corresponding to the field name. If name != field::unknown , then this value must be equal to to_string(name) using a case-insensitive comparison, otherwise the behavior is undefined. |
value | The value of the field, as a string_param |
|
inline |
Returns a copy of the key comparison function.
auto boost::beast::http::basic_fields< Allocator >::operator= | ( | basic_fields< Allocator > && | other | ) |
Move assignment.
The state of the moved-from object is as if constructed using the same allocator.
auto boost::beast::http::basic_fields< Allocator >::operator= | ( | basic_fields< Allocator > const & | other | ) |
Copy assignment.
basic_fields& boost::beast::http::basic_fields< Allocator >::operator= | ( | basic_fields< OtherAlloc > const & | ) |
Copy assignment.
auto boost::beast::http::basic_fields< Allocator >::operator= | ( | basic_fields< OtherAlloc > const & | other | ) | -> basic_fields& |
string_view boost::beast::http::basic_fields< Allocator >::operator[] | ( | field | name | ) | const |
Returns the value for a field, or ""
if it does not exist.
If more than one field with the specified name exists, the first field defined by insertion order is returned.
name | The name of the field. |
string_view boost::beast::http::basic_fields< Allocator >::operator[] | ( | string_view | name | ) | const |
Returns the value for a case-insensitive matching header, or ""
if it does not exist.
If more than one field with the specified name exists, the first field defined by insertion order is returned.
name | The name of the field. |
void boost::beast::http::basic_fields< Allocator >::set | ( | field | name, |
string_param const & | value | ||
) |
Set a field value, removing any other instances of that field.
First removes any values with matching field names, then inserts the new field value.
name | The field name. |
value | The value of the field, as a string_param |
void boost::beast::http::basic_fields< Allocator >::set | ( | string_view | name, |
string_param const & | value | ||
) |
Set a field value, removing any other instances of that field.
First removes any values with matching field names, then inserts the new field value.
name | The field name. |
value | The value of the field, as a string_param |
|
protected |
Adjusts the chunked Transfer-Encoding value
|
protected |
Sets or clears the Content-Length field
|
protected |
Adjusts the Connection field
|
inlineprotected |
Set or clear the method string.
|
inlineprotected |
Set or clear the reason string.
|
inlineprotected |
Set or clear the target string.
void boost::beast::http::basic_fields< Allocator >::swap | ( | basic_fields< Allocator > & | other | ) |
Swap this container with another.
Return a buffer sequence representing the trailers.
This function returns a buffer sequence holding the serialized representation of the trailer fields promised in the Accept field. Before calling this function the Accept field must contain the exact trailer fields desired. Each field must also exist.
|
friend |
|
friend |
Swap two field containers.