20 #ifndef RIPPLE_SERVER_SIMPLEWRITER_H_INCLUDED
21 #define RIPPLE_SERVER_SIMPLEWRITER_H_INCLUDED
23 #include <ripple/server/Writer.h>
24 #include <boost/beast/core/multi_buffer.hpp>
25 #include <boost/beast/core/ostream.hpp>
26 #include <boost/beast/http/message.hpp>
27 #include <boost/beast/http/write.hpp>
35 boost::beast::multi_buffer
sb_;
38 template <
bool isRequest,
class Body,
class Fields>
40 boost::beast::http::message<isRequest, Body, Fields>
const& msg)
42 boost::beast::ostream(
sb_) << msg;
48 return sb_.size() == 0;
66 auto const& buf =
sb_.data();
69 for (
auto const b : buf)
std::vector< boost::asio::const_buffer > data() override
Returns a ConstBufferSequence representing the input sequence.
SimpleWriter(boost::beast::http::message< isRequest, Body, Fields > const &msg)
Deprecated: Writer that serializes a HTTP/1 message.
void consume(std::size_t bytes) override
Removes bytes from the input sequence.
bool complete() override
Returns true if there is no more data to pull.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
boost::beast::multi_buffer sb_
bool prepare(std::size_t bytes, std::function< void(void)>) override
Add data to the input sequence.