# Multipart.hpp

This File On Github
Ask A Question

API: latest
module: oatpp
#include "oatpp/web/mime/multipart/Multipart.hpp"

# Headers

Namespace: oatpp::web::mime::multipart

Typedef for headers map. Headers map key is case-insensitive. For more info see oatpp::data::share::LazyStringMap.

typedef oatpp::data::share::LazyStringMap<oatpp::data::share::StringKeyLabelCI_FAST> Headers

# Multipart

Abstract Multipart.

namespace oatpp { namespace web { namespace mime { namespace multipart { 
  class Multipart {}
}}}}

# Methods

Return Type Name Summary
[none] Multipart Constructor.
[none] ~Multipart Default virtual Destructor.
oatpp::String getBoundary Get multipart boundary value.
std::shared_ptr<Part> readNextPart Read part-by-part from Multipart.
void writeNextPart Write part-by-part to Multipart.
std::shared_ptr<Part> readNextPartSimple Read part-by-part from Multipart.
void writeNextPartSimple Write part-by-part to Multipart.
oatpp::String generateRandomBoundary Generate random boundary for Multipart object. Base64 encoded.
oatpp::String parseBoundaryFromHeaders Parse boundary value from headers

# Multipart::Multipart

Constructor.

  • @param boundary - multipart boundary value.

Multipart(const oatpp::String& boundary)

# Multipart::~Multipart

Default virtual Destructor.

virtual ~Multipart() = default

# Multipart::getBoundary

Get multipart boundary value.

  • @return - multipart boundary value.

oatpp::String getBoundary()

# Multipart::readNextPart

Read part-by-part from Multipart.

  • @return

virtual std::shared_ptr<Part> readNextPart(async::Action& action) = 0

# Multipart::writeNextPart

Write part-by-part to Multipart.

  • @param part

virtual void writeNextPart(const std::shared_ptr<Part>& part, async::Action& action) = 0

# Multipart::readNextPartSimple

Read part-by-part from Multipart.
Call writeNextPart(...) and throw if action.isNone() == false.

  • @return

std::shared_ptr<Part> readNextPartSimple()

# Multipart::writeNextPartSimple

Write part-by-part to Multipart. Call writeNextPartSimple(...) and throw if action.isNone() == false.

  • @param part

void writeNextPartSimple(const std::shared_ptr<Part>& part)

# Multipart::generateRandomBoundary

Generate random boundary for Multipart object. Base64 encoded.

  • @param boundarySize - size in bytes of random vector.
  • @return - oatpp::String.

static oatpp::String generateRandomBoundary(v_int32 boundarySize = 15)

# Multipart::parseBoundaryFromHeaders

Parse boundary value from headers

  • @param headers
  • @return

static oatpp::String parseBoundaryFromHeaders(const Headers& requestHeaders)