forked from boostorg/beast
134 lines
3.0 KiB
Plaintext
134 lines
3.0 KiB
Plaintext
[/
|
|
Copyright (c) 2013-2017 Vinnie Falco (vinnie dot falco at gmail dot com)
|
|
|
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
|
]
|
|
|
|
[section:FieldSequence FieldSequence]
|
|
|
|
A [*FieldSequence] is an iterable container whose value type meets
|
|
the requirements of [link beast.concept.Field [*Field]]. Objects that meet
|
|
these requirements become serializable by the implementation.
|
|
|
|
In this table:
|
|
|
|
* `X` denotes a type that meets the requirements of [*FieldSequence].
|
|
|
|
* `c` is a value of type `X const`.
|
|
|
|
[table FieldSequence requirements
|
|
[[expression][type][semantics, pre/post-conditions]]
|
|
[
|
|
[`X::value_type`]
|
|
[]
|
|
[
|
|
A type that meets the requirements of
|
|
[link beast.concept.Field [*Field]].
|
|
]
|
|
]
|
|
[
|
|
[`X::const_iterator`]
|
|
[]
|
|
[
|
|
An iterator type whose `reference` type meets the
|
|
requirements of [link beast.concept.Field [*Field]], and which
|
|
satisfies all the requirements of [*ForwardIterator],
|
|
except that:
|
|
|
|
[ordered_list
|
|
[there is no requirement that `operator->` is provided, and]
|
|
[there is no requirement that `reference` be a reference type.]
|
|
]
|
|
]
|
|
]
|
|
[
|
|
[`c.begin()`]
|
|
[`X::const_iterator`]
|
|
[
|
|
Returns an iterator to the beginning of the field sequence.
|
|
]
|
|
]
|
|
[
|
|
[`c.end()`]
|
|
[`X::const_iterator`]
|
|
[
|
|
Returns an iterator to the end of the field sequence.
|
|
]
|
|
]
|
|
]
|
|
|
|
[endsect]
|
|
|
|
|
|
|
|
[/
|
|
|
|
/** OutputFields
|
|
|
|
Can be serialized by `beast::http::serializer`
|
|
*/
|
|
public:
|
|
// This algorithm produces a set of buffers
|
|
// corresponding to the serialized representation
|
|
// of the fields
|
|
//
|
|
struct reader
|
|
{
|
|
using const_buffers_type = implementation-defined
|
|
|
|
...
|
|
};
|
|
|
|
protected:
|
|
string_view method_impl() const;
|
|
string_view target_impl() const;
|
|
string_view reason_impl() const;
|
|
|
|
bool close_impl () const;
|
|
bool chunked_impl () const;
|
|
bool content_length_impl () const;
|
|
|
|
|
|
|
|
/** InputFields
|
|
|
|
Can be parsed by `beast::http::parser`
|
|
*/
|
|
public:
|
|
void insert (field f, string_view value);
|
|
void insert (string_view name, string_view value);
|
|
|
|
protected:
|
|
void method_impl (string_view s);
|
|
void target_impl (string_view s);
|
|
void reason_impl (string_view s);
|
|
|
|
|
|
/** Fields
|
|
|
|
Has a container interface and supports input and output.
|
|
`beast::http:basic_fields` is a model.
|
|
*/
|
|
|
|
public:
|
|
bool exists(field f) const;
|
|
bool exists(string_view s) const;
|
|
|
|
iterator find(field f) const;
|
|
iterator find(string_view s);
|
|
|
|
std::size_t erase (field f);
|
|
std::size_t erase (string_view s);
|
|
iterator erase (iterator);
|
|
|
|
protected:
|
|
void content_length_impl(std::uint64_t n);
|
|
void connection_impl(close_t);
|
|
void connection_impl(keep_alive_t);
|
|
void connection_impl(upgrade_t);
|
|
void chunked_impl();
|
|
|
|
|
|
]
|