Transfer Ease
|
Manage a ressource request informations. More...
Public Types | |
enum | TypeTransfer { TRANSFER_UNK = 0 , TRANSFER_DOWNLOAD , TRANSFER_UPLOAD } |
List of types of transfers. More... | |
using | PtrShared = std::shared_ptr<Request> |
using | List = std::vector<PtrShared> |
Public Member Functions | |
void | clear () |
void | configureDownload (const Url &targetUrl) |
Use to configure download request. | |
void | configureUpload (const Url &dstUrl, const BytesArray &inputData) |
Use to configure upload request. | |
void | configureUpload (const Url &dstUrl, BytesArray &&inputData) |
TypeTransfer | getTypeTransfer () const |
const Url & | getUrl () const |
BytesArray & | getData () |
const BytesArray & | getData () const |
size_t | ioRead (char *buffer, size_t nbBytes) |
void | ioSetSizeTotal (size_t size) |
void | ioSetSizeCurrent (size_t size) |
void | ioRegisterTry () |
void | ioAbort () |
void | ioReset () |
size_t | ioGetSizeTotal () const |
size_t | ioGetSizeCurrent () const |
int | ioGetNbTrials () const |
bool | ioIsAbort () const |
Manage a ressource request informations.
This class will be used to store request informations : where to download, where to upload, etc... and associated datas.
This class will be responsible to store I/O informations used during transfer.
using tease::Request::List = std::vector<PtrShared> |
Alias representing a list of requests
using tease::Request::PtrShared = std::shared_ptr<Request> |
Request shared pointer type alias
void tease::Request::configureDownload | ( | const Url & | targetUrl | ) |
Use to configure download request.
Once request transfer will be completed (and with sucess), downloaded data will be available via getData()
.
[in] | targetUrl | URL of ressource to download |
void tease::Request::configureUpload | ( | const Url & | dstUrl, |
BytesArray && | inputData ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
[in] | dstUrl | URL used to upload the ressource. |
[in,out] | inputData | Data to upload without performing a deep copy. Can be called with: request->configureUpload(myCustomUrl, std::move(byteArrayToUpload));
|
void tease::Request::configureUpload | ( | const Url & | dstUrl, |
const BytesArray & | inputData ) |
Use to configure upload request.
[in] | dstUrl | URL used to upload the ressource. |
[in] | inputData | Data to upload. Those will be copied, so to limit copy, please use the overloaded method. |