Kanzi Connect 3.9.10
kanzi::connect::VirtualFileResponse Class Reference

Response object that is used by the clients to complete the file request. More...

#include <virtualfileresponse.hpp>

Public Member Functions

bool deferredCompletionRequested () const
 Retrieve the deferred completion status.
 
void provideAsFileThroughHttp (const string &filepath)
 Provide requested file as existing file in filesystem through http protocol.
 
void provideAsHttpContent (const string &mime, const unsigned char *blob, size_t length)
 Provide requested file as inline content through http.
 
void provideAsRedirectUri (const string &uri)
 Return response as a redirect to another uri.
 
void provideFileDirectly (const string &uri, vector< char > &buffer)
 Provide response as file contents through the connection adapters.
 
void requestDeferredCompletion ()
 Requests deferred completion for the object.
 
 VirtualFileResponse (VirtualFileLocalResponseInterface *manager, VirtualFileWorkItemSharedPtr workItem, unsigned int blockSize)
 C++ constructor used by the Local clients.
 
 VirtualFileResponse (VirtualFileRemoteResponseInterface *responseInterface, int handle, unsigned int blockSize)
 C++ constructor used by the remote clients.
 
bool wasProvided () const
 Can be used to example whether any of the provide functions have been called.
 
virtual ~VirtualFileResponse ()
 virtual destructor.
 

Detailed Description

Response object that is used by the clients to complete the file request.

Constructor & Destructor Documentation

◆ VirtualFileResponse() [1/2]

kanzi::connect::VirtualFileResponse::VirtualFileResponse ( VirtualFileLocalResponseInterface * manager,
VirtualFileWorkItemSharedPtr workItem,
unsigned int blockSize )

C++ constructor used by the Local clients.

Parameters
managerpointer to virtualfilemanager instance that is used to complete the operation.
workItemwork item used to carry the response information.
blockSizeIn what size pieces to send the file if a buffer is to be transferred

◆ VirtualFileResponse() [2/2]

kanzi::connect::VirtualFileResponse::VirtualFileResponse ( VirtualFileRemoteResponseInterface * responseInterface,
int handle,
unsigned int blockSize )

C++ constructor used by the remote clients.

Parameters
responseInterfaceservice interface used to deliver responses
handleunique request handle - passed as argument.
blockSizeIn what size pieces to send the file if a buffer is to be transferred

◆ ~VirtualFileResponse()

virtual kanzi::connect::VirtualFileResponse::~VirtualFileResponse ( )
inlinevirtual

virtual destructor.

Member Function Documentation

◆ deferredCompletionRequested()

bool kanzi::connect::VirtualFileResponse::deferredCompletionRequested ( ) const

Retrieve the deferred completion status.

Returns
true if deferred completion has been requested.

◆ provideAsFileThroughHttp()

void kanzi::connect::VirtualFileResponse::provideAsFileThroughHttp ( const string & filepath)

Provide requested file as existing file in filesystem through http protocol.

Parameters
filepathpath to file to return.

◆ provideAsHttpContent()

void kanzi::connect::VirtualFileResponse::provideAsHttpContent ( const string & mime,
const unsigned char * blob,
size_t length )

Provide requested file as inline content through http.

Parameters
mimemime type of for the content provided
blobraw block of data to report
lengthsize of raw data.

◆ provideAsRedirectUri()

void kanzi::connect::VirtualFileResponse::provideAsRedirectUri ( const string & uri)

Return response as a redirect to another uri.

Parameters
uriwhere should the client be redirected.

◆ provideFileDirectly()

void kanzi::connect::VirtualFileResponse::provideFileDirectly ( const string & uri,
vector< char > & buffer )

Provide response as file contents through the connection adapters.

Parameters
uriIdentifies the file
bufferThe data to provide as file, this data is consumed

◆ requestDeferredCompletion()

void kanzi::connect::VirtualFileResponse::requestDeferredCompletion ( )

Requests deferred completion for the object.

◆ wasProvided()

bool kanzi::connect::VirtualFileResponse::wasProvided ( ) const

Can be used to example whether any of the provide functions have been called.

Returns
true if data has been "provided".

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