Molybden API
Loading...
Searching...
No Matches
molybden::UploadData Class Referenceabstract

An interface that all upload data implementations must extend. More...

#include <upload_data.hpp>

Inheritance diagram for molybden::UploadData:
molybden::ByteData molybden::FormData molybden::MultipartFormData molybden::TextData

Public Member Functions

template<class S >
std::shared_ptr< S > as ()
 Casts this upload data to the target type.
 

Protected Member Functions

virtual UploadDataType type () const =0
 Returns the current upload data type.
 

Detailed Description

An interface that all upload data implementations must extend.

Member Function Documentation

◆ as()

template<class S >
std::shared_ptr< S > molybden::UploadData::as ( )

Casts this upload data to the target type.

Returns an empty std::shared_ptr if this upload data is not of the given target type. For example:

if (auto text_data = upload_data->As<TextData>()) {
const std::string& string = text_data->Value();
}
An upload data of the "text/plain" content type.
Definition upload_data.hpp:78
Template Parameters
Sthe target type that must be the UploadData subclass.
See also
ByteData
TextData
FormData
MultipartFormData

The documentation for this class was generated from the following file: