10 #ifndef BOOST_BEAST_HTTP_FIELDS_HPP 11 #define BOOST_BEAST_HTTP_FIELDS_HPP 18 #include <boost/asio/buffer.hpp> 19 #include <boost/intrusive/list.hpp> 20 #include <boost/intrusive/set.hpp> 21 #include <boost/optional.hpp> 27 #include <type_traits> 52 template<
class Allocator>
57 static std::size_t constexpr max_static_buffer = 4096;
59 using off_t = std::uint16_t;
70 boost::asio::const_buffer
76 boost::intrusive::list_member_hook<
77 boost::intrusive::link_mode<
78 boost::intrusive::normal_link>>
80 boost::intrusive::set_member_hook<
81 boost::intrusive::link_mode<
82 boost::intrusive::normal_link>>
115 template<
class String>
121 if(lhs.size() < rhs.name_string().size())
123 if(lhs.size() > rhs.name_string().size())
129 template<
class String>
133 String
const& rhs)
const noexcept
135 if(lhs.name_string().size() < rhs.size())
137 if(lhs.name_string().size() > rhs.size())
148 if(lhs.name_string().size() < rhs.name_string().size())
150 if(lhs.name_string().size() > rhs.name_string().size())
157 #if BOOST_BEAST_DOXYGEN 158 using reader = implementation_defined;
164 using list_t =
typename boost::intrusive::make_list<
166 value_type, boost::intrusive::list_member_hook<
167 boost::intrusive::link_mode<
168 boost::intrusive::normal_link>>,
169 &value_type::list_hook_>,
170 boost::intrusive::constant_time_size<
173 using set_t =
typename boost::intrusive::make_multiset<
174 value_type, boost::intrusive::member_hook<value_type,
175 boost::intrusive::set_member_hook<
176 boost::intrusive::link_mode<
177 boost::intrusive::normal_link>>,
178 &value_type::set_hook_>,
179 boost::intrusive::constant_time_size<true>,
180 boost::intrusive::compare<key_compare>>::type;
223 template<
class OtherAlloc>
230 template<
class OtherAlloc>
232 Allocator
const& alloc);
245 template<
class OtherAlloc>
250 #if BOOST_BEAST_DOXYGEN 330 return list_.cbegin();
344 return list_.cbegin();
366 return list_.empty();
519 template<
class Alloc>
577 std::pair<const_iterator, const_iterator>
587 std::pair<const_iterator, const_iterator>
665 boost::optional<std::uint64_t>
const& value);
674 template<
class OtherAlloc>
677 using base_alloc_type =
typename 679 template rebind_alloc<value_type>;
684 using size_type =
typename 688 new_element(
field name,
692 delete_element(value_type& e);
695 set_element(value_type& e);
704 template<
class OtherAlloc>
732 base_alloc_type alloc_;
void set_keep_alive_impl(unsigned version, bool keep_alive)
Definition: fields.ipp:1084
void set_target_impl(string_view s)
Definition: fields.ipp:956
Definition: async_result.hpp:20
field
Definition: field.hpp:21
std::pair< const_iterator, const_iterator > equal_range(field name) const
Definition: fields.ipp:713
bool operator()(String const &lhs, value_type const &rhs) const noexcept
Returns true if lhs is less than rhs using a strict ordering.
Definition: fields.hpp:117
const_iterator iterator
A constant iterator to the field sequence.
Definition: fields.hpp:257
string_view get_method_impl() const
Definition: fields.ipp:880
string_view get_reason_impl() const
Definition: fields.ipp:902
string_view value() const
Returns the value of the field.
Definition: fields.ipp:321
Definition: beast_common.hpp:6
Definition: fields.ipp:37
const_iterator begin() const
Return a const iterator to the beginning of the field sequence.
Definition: fields.hpp:328
Definition: string_param.hpp:42
bool operator()(value_type const &lhs, value_type const &rhs) const noexcept
Returns true if lhs is less than rhs using a strict ordering.
Definition: fields.hpp:144
Definition: fields.hpp:53
const_iterator end() const
Return a const iterator to the end of the field sequence.
Definition: fields.hpp:335
Definition: fields.hpp:112
field name() const
Returns the field enum, which can be field::unknown.
Definition: fields.ipp:299
bool operator()(value_type const &lhs, String const &rhs) const noexcept
Returns true if lhs is less than rhs using a strict ordering.
Definition: fields.hpp:131
The type of element used to represent a field.
Definition: fields.hpp:66
bool get_chunked_impl() const
Definition: fields.ipp:910
string_view at(field name) const
Definition: fields.ipp:472
void set_method_impl(string_view s)
Definition: fields.ipp:947
void insert(field name, string_param const &value)
Definition: fields.ipp:537
value_type & operator=(value_type const &)=delete
Assignment (deleted)
boost::string_ref string_view
The type of string view used by the library.
Definition: string.hpp:36
~basic_fields()
Destructor.
Definition: fields.ipp:344
string_view get_target_impl() const
Definition: fields.ipp:889
void set_content_length_impl(boost::optional< std::uint64_t > const &value)
Definition: fields.ipp:1072
allocator_type get_allocator() const
Return a copy of the allocator associated with the container.
Definition: fields.hpp:261
const_iterator find(field name) const
Definition: fields.ipp:689
Allocator allocator_type
The type of allocator used.
Definition: fields.hpp:63
void swap(basic_fields &other)
Swap this container with another.
Definition: fields.ipp:646
std::allocator_traits< Alloc > allocator_traits
Definition: allocator.hpp:34
void set_reason_impl(string_view s)
Definition: fields.ipp:966
bool get_keep_alive_impl(unsigned version) const
Definition: fields.ipp:927
Definition: string.hpp:118
string_view operator[](field name) const
Definition: fields.ipp:497
string_view name_string() const
Returns the field name as a string.
Definition: fields.ipp:309
friend class fields_test
Definition: fields.hpp:55
const_iterator erase(const_iterator pos)
Definition: fields.ipp:607
typename list_t::const_iterator const_iterator
A constant iterator to the field sequence.
Definition: fields.hpp:253
key_compare key_comp() const
Returns a copy of the key comparison function.
Definition: fields.hpp:598
void set_chunked_impl(bool value)
Definition: fields.ipp:975
const_iterator cend() const
Return a const iterator to the end of the field sequence.
Definition: fields.hpp:349
friend class basic_fields
Definition: fields.hpp:68
const_iterator cbegin() const
Return a const iterator to the beginning of the field sequence.
Definition: fields.hpp:342
bool operator()(string_view lhs, string_view rhs) const
Definition: string.hpp:121
std::size_t count(field name) const
Definition: fields.ipp:671