C++ edjLibrary SDK
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
edjx::storage::StorageResponse Struct Reference

Response to the [edjx::storage::get] request. More...

#include <storage.hpp>

Public Member Functions

 StorageResponse ()
 Constructs a response with no headers and an empty body. More...
 
 StorageResponse (const std::map< std::string, std::string > &headers, const edjx::stream::ReadStream &read_stream)
 Constructs a response with headers and body set to the provided values. More...
 
const std::map< std::string, std::string > & get_headers () const
 Returns the metadata associated with the storage object. More...
 
edjx::error::StreamError read_body (std::vector< uint8_t > &result)
 Retrieves the bytes of the storage object. More...
 
const edjx::stream::ReadStreamget_read_stream () const
 Returns a read stream for the storage object. More...
 

Public Attributes

std::map< std::string, std::string > headers
 HTTP headers of the response. More...
 
edjx::stream::ReadStream read_stream
 Body of the response as a read stream. More...
 

Detailed Description

Response to the [edjx::storage::get] request.

Constructor & Destructor Documentation

◆ StorageResponse() [1/2]

edjx::storage::StorageResponse::StorageResponse ( )
inline

Constructs a response with no headers and an empty body.

◆ StorageResponse() [2/2]

edjx::storage::StorageResponse::StorageResponse ( const std::map< std::string, std::string > &  headers,
const edjx::stream::ReadStream read_stream 
)
inline

Constructs a response with headers and body set to the provided values.

Parameters
headersHTTP headers for the response
read_streamRead stream for the body of the response

Member Function Documentation

◆ get_headers()

const std::map< std::string, std::string > & edjx::storage::StorageResponse::get_headers ( ) const

Returns the metadata associated with the storage object.

Returns
Response headers

◆ get_read_stream()

const edjx::stream::ReadStream & edjx::storage::StorageResponse::get_read_stream ( ) const

Returns a read stream for the storage object.

Returns
Read stream

◆ read_body()

edjx::error::StreamError edjx::storage::StorageResponse::read_body ( std::vector< uint8_t > &  result)

Retrieves the bytes of the storage object.

Parameters
resultResponse body
Returns
Returns StorageError::Success on success, StorageError::Success::EndOfStream when end of stream is reached, or some other value on failure.

Member Data Documentation

◆ headers

std::map<std::string, std::string> edjx::storage::StorageResponse::headers

HTTP headers of the response.

◆ read_stream

edjx::stream::ReadStream edjx::storage::StorageResponse::read_stream

Body of the response as a read stream.


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