ChunkedBufferBody.hpp

This File On Github
Ask A Question

API: latest
module: oatpp
#include "oatpp/web/protocol/http/outgoing/ChunkedBufferBody.hpp"

ChunkedBufferBody

Implementation of oatpp::web::protocol::http::outgoing::Body class. Implements functionality to use :oatpp::data::stream::ChunkedBuffer as data source for http body.

namespace oatpp { namespace web { namespace protocol { namespace http { namespace outgoing { 
  class ChunkedBufferBody : public oatpp::base::Countable, public Body, public std::enable_shared_from_this<ChunkedBufferBody> {}
}}}}}

Methods

Return Type Name Summary
[none] ChunkedBufferBody Constructor.
std::shared_ptr<ChunkedBufferBody> createShared Create shared ChunkedBufferBody.
void declareHeaders Add Content-Length header.
void writeToStream Write body data to stream.
oatpp::async::CoroutineStarter writeToStreamAsync Start ChunkedBufferBody::WriteToStreamCoroutine to write buffer data to stream.
data::v_io_size getKnownSize Return known size of the body.

ChunkedBufferBody::ChunkedBufferBody

Constructor.

  • @param buffer - :oatpp::data::stream::ChunkedBuffer.

ChunkedBufferBody(const std::shared_ptr<oatpp::data::stream::ChunkedBuffer>& buffer)

ChunkedBufferBody::createShared

Create shared ChunkedBufferBody.

  • @param buffer - :oatpp::data::stream::ChunkedBuffer.
  • @return - std::shared_ptr to ChunkedBufferBody.

static std::shared_ptr<ChunkedBufferBody> createShared(const std::shared_ptr<oatpp::data::stream::ChunkedBuffer>& buffer)

ChunkedBufferBody::declareHeaders

Add Content-Length header.

void declareHeaders(Headers& headers) noexcept override

ChunkedBufferBody::writeToStream

Write body data to stream.

void writeToStream(OutputStream* stream) noexcept override

ChunkedBufferBody::writeToStreamAsync

Start ChunkedBufferBody::WriteToStreamCoroutine to write buffer data to stream.

oatpp::async::CoroutineStarter writeToStreamAsync(const std::shared_ptr<OutputStream>& stream) override

ChunkedBufferBody::getKnownSize

Return known size of the body.

data::v_io_size getKnownSize() override