# PartList.hpp

This File On Github
Ask A Question

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

# PartList

Structure that holds Multipart parts in the std::list.

namespace oatpp { namespace web { namespace mime { namespace multipart { 
  class PartList : public Multipart {}
}}}}

# Methods

Return Type Name Summary
[none] PartList Multiple implementations:
  1. Constructor.
  2. Constructor.
std::shared_ptr<PartList> createSharedWithRandomBoundary Create Multipart object with random boundary.
std::shared_ptr<Part> readNextPart Read part-by-part from Multipart.
void writeNextPart Write part-by-part to Multipart.
std::shared_ptr<Part> getNamedPart Get part by name
const std::list<std::shared_ptr<Part>>& getAllParts Get list of all parts.
v_int64 count Get parts count.

# PartList::PartList

  1. Constructor.
    • @param boundary - multipart boundary value.
    PartList(const oatpp::String& boundary)
    
  2. Constructor.
    • @param requestHeaders - request headers. Headers must contain "Content-Type" header.
    PartList(const Headers& requestHeaders)
    

# PartList::createSharedWithRandomBoundary

Create Multipart object with random boundary.
It will generate random vector of size boundarySize in bytes encoded in base64.

  • @param boundarySize - size of the random vecrot in bytes.
  • @return - std::shared_ptr to Multipart.

static std::shared_ptr<PartList> createSharedWithRandomBoundary(v_int32 boundarySize = 15)

# PartList::readNextPart

Read part-by-part from Multipart.

  • @return

std::shared_ptr<Part> readNextPart(async::Action& action) override

# PartList::writeNextPart

Write part-by-part to Multipart.

  • @param part

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

# PartList::getNamedPart

Get part by name
Applicable to named parts only.

std::shared_ptr<Part> getNamedPart(const oatpp::String& name)

# PartList::getAllParts

Get list of all parts.

const std::list<std::shared_ptr<Part>>& getAllParts()

# PartList::count

Get parts count.

  • @return - parts count.

v_int64 count()