BufferBody.hpp

This File On Github
Ask A Question

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

BufferBody

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

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

Methods

Return Type Name Summary
std::shared_ptr<BufferBody> createShared Create shared BufferBody.
void declareHeaders Declare Content-Length header.
void writeToStream Write body data to stream.
oatpp::async::CoroutineStarter writeToStreamAsync Start BufferBody::WriteToStreamCoroutine to write buffer data to stream.

BufferBody::createShared

Create shared BufferBody.

  • @param buffer - oatpp::String.
  • @return - std::shared_ptr to BufferBody.

static std::shared_ptr<BufferBody> createShared(const oatpp::String& buffer)

BufferBody::declareHeaders

Declare Content-Length header.

void declareHeaders(Headers& headers) noexcept override

BufferBody::writeToStream

Write body data to stream.

void writeToStream(const std::shared_ptr<OutputStream>& stream) noexcept override

BufferBody::writeToStreamAsync

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

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

BufferBody::WriteToStreamCoroutine

Coroutine used to write BufferBody to oatpp::data::stream::OutputStream.

namespace oatpp { namespace web { namespace protocol { namespace http { namespace outgoing { 
  class BufferBody : public oatpp::base::Countable, public Body, public std::enable_shared_from_this<BufferBody> {
    class WriteToStreamCoroutine : public oatpp::async::Coroutine<WriteToStreamCoroutine> {}
  };
}}}}}

Methods

Return Type Name Summary
[none] WriteToStreamCoroutine Constructor.

BufferBody::WriteToStreamCoroutine::WriteToStreamCoroutine

Constructor.

WriteToStreamCoroutine(const std::shared_ptr<BufferBody>& body,
                       const std::shared_ptr<OutputStream>& stream)