10 #ifndef BOOST_BEAST_HTTP_SERIALIZER_HPP 11 #define BOOST_BEAST_HTTP_SERIALIZER_HPP 22 #include <boost/asio/buffer.hpp> 23 #include <boost/optional.hpp> 64 "Body requirements not met");
67 "BodyReader requirements not met");
74 #if BOOST_BEAST_DOXYGEN 78 typename std::conditional<
79 std::is_constructible<
typename Body::reader,
81 ! std::is_constructible<
typename Body::reader,
84 message<isRequest, Body, Fields>
const>::type;
98 do_header_only_c = 60,
102 #ifndef BOOST_BEAST_NO_BIG_VARIANTS 103 do_body_final_c = 100,
110 void frdinit(std::true_type);
111 void frdinit(std::false_type);
113 template<std::
size_t,
class Visit>
117 using reader =
typename Body::reader;
120 Fields::reader::const_buffers_type>;
124 typename Fields::reader::const_buffers_type,
125 typename reader::const_buffers_type>>;
129 typename reader::const_buffers_type>;
133 typename Fields::reader::const_buffers_type,
135 boost::asio::const_buffers_1,
137 typename reader::const_buffers_type,
143 boost::asio::const_buffers_1,
145 typename reader::const_buffers_type,
151 boost::asio::const_buffers_1,
153 typename reader::const_buffers_type,
155 boost::asio::const_buffers_1,
156 boost::asio::const_buffers_1,
161 typename Fields::reader::const_buffers_type,
163 boost::asio::const_buffers_1,
165 typename reader::const_buffers_type,
167 boost::asio::const_buffers_1,
168 boost::asio::const_buffers_1,
173 boost::asio::const_buffers_1,
174 boost::asio::const_buffers_1,
180 boost::optional<typename Fields::reader> frd_;
188 (std::numeric_limits<std::size_t>::max)();
189 int s_ = do_construct;
191 bool header_done_ =
false;
251 limit_ = limit > 0 ? limit :
252 (std::numeric_limits<std::size_t>::max)();
296 return s_ == do_complete;
358 template<
class Visit>
397 template<
class Body,
class Fields = fields>
401 template<
class Body,
class Fields = fields>
void next(error_code &ec, Visit &&visit)
Definition: serializer.ipp:72
Definition: async_result.hpp:20
Definition: type_traits.hpp:25
Definition: consuming_buffers.hpp:40
bool is_header_done()
Definition: serializer.hpp:282
bool keep_alive()
Definition: serializer.hpp:329
Definition: beast_common.hpp:6
bool split()
Definition: serializer.hpp:258
serializer & operator=(serializer const &)=delete
Assignment.
serializer(serializer &&)=default
Constructor.
Definition: type_traits.hpp:79
boost::system::error_code error_code
The type of error code used by the library.
Definition: error.hpp:21
bool is_done()
Definition: serializer.hpp:294
reader & reader_impl()
Definition: serializer.hpp:390
Definition: buffer_cat.hpp:25
Definition: buffer_prefix.hpp:32
Definition: serializer.hpp:60
void consume(std::size_t n)
Definition: serializer.ipp:288
Definition: type_traits.hpp:73
Definition: variant.hpp:32
void split(bool v)
Definition: serializer.hpp:271
basic_fields< std::allocator< char >> fields
A typical HTTP header fields container.
Definition: fields.hpp:740
boost::asio::const_buffers_1 chunk_crlf()
Returns a buffer sequence holding a CRLF for chunk encoding.
Definition: chunk_encode.hpp:155
std::size_t limit()
Returns the serialized buffer size limit.
Definition: serializer.hpp:232
typename std::conditional< std::is_constructible< typename Body::reader, message< isRequest, Body, Fields > & >::value &&!std::is_constructible< typename Body::reader, message< isRequest, Body, Fields > const & >::value, message< isRequest, Body, Fields >, message< isRequest, Body, Fields > const >::type value_type
Definition: serializer.hpp:84
void limit(std::size_t limit)
Definition: serializer.hpp:249
bool chunked()
Definition: serializer.hpp:305
Definition: chunk_encode.hpp:68