FileStreamProvider.hpp

This File On Github
Ask A Question

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

FileStreamProvider

Stream provider for StreamPartReader.

namespace oatpp { namespace web { namespace mime { namespace multipart { 
  class FileStreamProvider : public PartReaderStreamProvider {}
}}}}

Typedefs

Type Name Summary
oatpp::data::stream::OutputStream OutputStream Convenience typedef for oatpp::data::stream::OutputStream.
oatpp::data::stream::InputStream InputStream Convenience typedef for oatpp::data::stream::InputStream.

Methods

Return Type Name Summary
[none] FileStreamProvider Constructor.
std::shared_ptr<OutputStream> getOutputStream Get stream to write (save) part data in.
std::shared_ptr<InputStream> getInputStream Get stream to read part data from.

FileStreamProvider::OutputStream

Convenience typedef for oatpp::data::stream::OutputStream.

typedef oatpp::data::stream::OutputStream OutputStream

FileStreamProvider::InputStream

Convenience typedef for oatpp::data::stream::InputStream.

typedef oatpp::data::stream::InputStream InputStream

FileStreamProvider::FileStreamProvider

Constructor.

  • @param filename

FileStreamProvider(const oatpp::String& filename)

FileStreamProvider::getOutputStream

Get stream to write (save) part data in.

  • @param part
  • @return

std::shared_ptr<OutputStream> getOutputStream(const std::shared_ptr<Part>& part) override

FileStreamProvider::getInputStream

Get stream to read part data from.
This method is called after all data has been streamed to OutputStream.

  • @param part
  • @return

std::shared_ptr<InputStream> getInputStream(const std::shared_ptr<Part>& part) override

AsyncFileStreamProvider

Async stream provider for AsyncStreamPartReader.

namespace oatpp { namespace web { namespace mime { namespace multipart { 
  class AsyncFileStreamProvider : public AsyncPartReaderStreamProvider {}
}}}}

Typedefs

Type Name Summary
oatpp::data::stream::OutputStream OutputStream Convenience typedef for oatpp::data::stream::OutputStream.
oatpp::data::stream::InputStream InputStream Convenience typedef for oatpp::data::stream::InputStream.

Methods

Return Type Name Summary
[none] AsyncFileStreamProvider Constructor.
async::CoroutineStarter getOutputStreamAsync Get stream to write (save) part data to.
async::CoroutineStarter getInputStreamAsync Get stream to read part data from.

AsyncFileStreamProvider::OutputStream

Convenience typedef for oatpp::data::stream::OutputStream.

typedef oatpp::data::stream::OutputStream OutputStream

AsyncFileStreamProvider::InputStream

Convenience typedef for oatpp::data::stream::InputStream.

typedef oatpp::data::stream::InputStream InputStream

AsyncFileStreamProvider::AsyncFileStreamProvider

Constructor.

  • @param filename

AsyncFileStreamProvider(const oatpp::String& filename)

AsyncFileStreamProvider::getOutputStreamAsync

Get stream to write (save) part data to.

  • @param part
  • @param stream - put here pointer to obtained stream.
  • @return

async::CoroutineStarter getOutputStreamAsync(const std::shared_ptr<Part>& part,
                                             std::shared_ptr<data::stream::OutputStream>& stream) override

AsyncFileStreamProvider::getInputStreamAsync

Get stream to read part data from.
This method is called after all data has been streamed to OutputStream.

  • @param part
  • @param stream - put here pointer to obtained stream.
  • @return

async::CoroutineStarter getInputStreamAsync(const std::shared_ptr<Part>& part,
                                            std::shared_ptr<data::stream::InputStream>& stream) override

createFilePartReader

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

Create file part reader.
Reader will save part to a specified file.

std::shared_ptr<PartReader> createFilePartReader(const oatpp::String& filename, data::v_io_size maxDataSize = -1)

createAsyncFilePartReader

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

Create async file part reader.
Reader will save part to a specified file.

std::shared_ptr<AsyncPartReader> createAsyncFilePartReader(const oatpp::String& filename, data::v_io_size maxDataSize = -1)