ReplicaNet and RNLobby
1
|
#include <ProductPatcher.h>
Public Types | |
enum | Status { kSuccess = 0, kErrorEncountered, kAborted } |
Public Member Functions | |
bool | Start (const char *productPath, const char *patchIndexURL, const char *patchDataURL, const bool multiThread=false, const size_t chunkSize=1024 *1024) |
bool | Stop (void) |
bool | GetCompleted (void) |
virtual bool | CallbackUpdateProgressProduct (const size_t fileIndex, const size_t maxFileIndex) |
virtual bool | CallbackUpdateDownloadPatch (const char *patchingFile, const size_t filePosition, const size_t fileLength) |
virtual bool | CallbackUpdateProgressFile (const char *patchingFile, const size_t filePosition, const size_t fileLength) |
virtual void | CallbackComplete (const Status status) |
A virtual callback that is triggered when the patching is complete. | |
virtual void | CallbackFailedToReadFile (const char *file) |
A virtual callback that is triggered when there is an error. | |
virtual bool | CallbackProcessFile (const char *file) |
void | GetDownloadAttemptsAndFailed (size_t &attempts, size_t &failed) const |
void | GetDownloadSpeed (size_t &totalBytes, float &overTime) const |
Gets information that can be used to calculate the download speed. | |
Protected Member Functions | |
void | Tidy (void) |
This patches a product from patch data and if there are any missing product files these will be created. A file date stamp and checksum cache is used to speed up checking of existing unchanged files.
|
virtual |
A virtual callback that is triggered to allow the client application to skip a file in the patch index during the patch process. The file only includes the entry as it is seen in the index and does not include any product path.
|
virtual |
A virtual callback that is triggered during the patching process.
|
virtual |
A virtual callback that is triggered during the patching process.
|
virtual |
A virtual callback that is triggered during the patching process.
bool GetCompleted | ( | void | ) |
Tests the completion state of the last patch.
void GetDownloadAttemptsAndFailed | ( | size_t & | attempts, |
size_t & | failed | ||
) | const |
Gets the number of attempted downloads and the number of downloads that failed and were automatically tried again. This can be useful for giving an indication of the health of a network connection during patching.
bool Start | ( | const char * | productPath, |
const char * | patchIndexURL, | ||
const char * | patchDataURL, | ||
const bool | multiThread = false , |
||
const size_t | chunkSize = 1024 *1024 |
||
) |
Starts patching a product given patch data paths.
productPath | The paths to the product to patch. |
multiThread | By default the scan does not use an extra thread. Using true will start a thread to start the patch process and Start() will return immediately. |
chunkSize | The number of bytes to use for a file buffer when accessing files. By default this uses a megabyte. The larger the buffer the quicker the download will be but the calls to CallbackUpdateDownloadPatch() will be less frequent. |
bool Stop | ( | void | ) |
Stops the current patch if it is running.