ProductPatcher Class Reference

#include <ProductPatcher.h>

Inheritance diagram for ProductPatcher:

Inheritance graph
[legend]
Collaboration diagram for ProductPatcher:

Collaboration graph
[legend]

List of all members.

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.

Protected Member Functions

void Tidy (void)


Detailed Description

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.

Member Function Documentation

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.

Parameters:
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.
Returns:
Success returns true, failure returns false.

bool Stop ( void   ) 

Stops the current patch if it is running.

Returns:
Success returns true, failure returns false.

bool GetCompleted ( void   ) 

Tests the completion state of the last patch.

Returns:
A completed patch returns true, a patch that is in progress returns false.

virtual bool CallbackUpdateProgressProduct ( const size_t  fileIndex,
const size_t  maxFileIndex 
) [virtual]

A virtual callback that is triggered during the patching process.

Returns:
True allows the patch to continue. False terminates the patch as quickly as possible.

virtual bool CallbackUpdateDownloadPatch ( const char *  patchingFile,
const size_t  filePosition,
const size_t  fileLength 
) [virtual]

A virtual callback that is triggered during the patching process.

Returns:
True allows the patch to continue. False terminates the patch as quickly as possible.

virtual bool CallbackUpdateProgressFile ( const char *  patchingFile,
const size_t  filePosition,
const size_t  fileLength 
) [virtual]

A virtual callback that is triggered during the patching process.

Returns:
True allows the patch to continue. False terminates the patch as quickly as possible.


Generated on Sat Jun 28 22:02:33 2008 for ReplicaNet and RNLobby by  doxygen 1.5.3