libzypp 17.37.17
zyppng::CurlMultiPartDataReceiver Class Referenceabstract

#include <zypp-curl/ng/network/curlmultiparthandler.h>

Inheritance diagram for zyppng::CurlMultiPartDataReceiver:

Public Member Functions

virtual ~CurlMultiPartDataReceiver ()=default
virtual size_t headerfunction (char *ptr, size_t bytes)=0
virtual size_t writefunction (char *ptr, std::optional< off_t > offset, size_t bytes)=0
virtual bool beginRange (off_t range, std::string &cancelReason)
virtual bool finishedRange (off_t range, bool validated, std::string &cancelReason)
virtual void notifyErrorCodeChanged ()

Detailed Description

Data receiver interface for the CurlMultiPartHandler class.

Definition at line 19 of file curlmultiparthandler.h.

Constructor & Destructor Documentation

◆ ~CurlMultiPartDataReceiver()

virtual zyppng::CurlMultiPartDataReceiver::~CurlMultiPartDataReceiver ( )
virtualdefault

Member Function Documentation

◆ headerfunction()

virtual size_t zyppng::CurlMultiPartDataReceiver::headerfunction ( char * ptr,
size_t bytes )
pure virtual

Called for all received header data, after it was processed by the CurlMultiPartHandler.

Implemented in zyppng::NetworkRequestPrivate.

◆ writefunction()

virtual size_t zyppng::CurlMultiPartDataReceiver::writefunction ( char * ptr,
std::optional< off_t > offset,
size_t bytes )
pure virtual

Data callback func, this is called whenever there is actual data to be written to the file. If offset is set, usually when starting to write a new range, it means to continue to write on the current file pointer position, otherwise seek to the given one.

Implemented in zyppng::NetworkRequestPrivate.

◆ beginRange()

virtual bool zyppng::CurlMultiPartDataReceiver::beginRange ( off_t range,
std::string & cancelReason )
inlinevirtual

Called everytime a new range is about to be written, returning false from the function will immediately cancel the request and not write anything to the file.

Parameters
rangeThe index of the range that is to be started
cancelReasonSet to indicate why the request was cancelled.

Definition at line 42 of file curlmultiparthandler.h.

◆ finishedRange()

virtual bool zyppng::CurlMultiPartDataReceiver::finishedRange ( off_t range,
bool validated,
std::string & cancelReason )
inlinevirtual

Called everytime a range was finished, returning false from the function will cancel the request.

Note
Normally CurlMultiPartHandler will try to finish all ranges before failing even if one of them can not be validated. If the code should cancel early do it via returning false here.
Parameters
rangeThe index of the range that was finished
validatedIndicates of the range data could be validated against its given checksum
cancelReasonSet to indicate why the request was cancelled.

Definition at line 54 of file curlmultiparthandler.h.

◆ notifyErrorCodeChanged()

virtual void zyppng::CurlMultiPartDataReceiver::notifyErrorCodeChanged ( )
inlinevirtual

Called everytime the error code changes, this is just to notify that a error was set

Reimplemented in zyppng::NetworkRequestPrivate.

Definition at line 59 of file curlmultiparthandler.h.


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