ReplicaNet and RNLobby  1
Public Member Functions | Public Attributes | List of all members
ScanForDiffs Class Reference

Public Member Functions

void SetNumVersions (const size_t numVersions=3)
 
size_t GetNumVersions (void)
 Gets the value from SetNumVersions().
 
bool Start (const char *patchIndexPath, const char *patchDataPath, const std::list< ScanPath::Entry > &productFiles, std::vector< size_t > &idsRemoved, const size_t stripProductPath=0, const size_t level=8)
 
virtual bool CallbackScanning (size_t pos, size_t max, const ScanPath::Entry &entry, const size_t filePos, const size_t fileMax)
 
int CompressFile (size_t pos, size_t max, const ScanPath::Entry &entry, const char *sourceFile, const char *destinationFile, const size_t level, const size_t chunkSize=256 *1024, const bool useCores=true)
 
int DecompressFile (size_t pos, size_t max, const ScanPath::Entry &entry, const char *sourceFile, const char *destinationFile)
 

Public Attributes

size_t mNumVersions
 

Member Function Documentation

virtual bool CallbackScanning ( size_t  pos,
size_t  max,
const ScanPath::Entry entry,
const size_t  filePos,
const size_t  fileMax 
)
virtual

A virtual callback that is triggered when the scanning status is updated. This can be called frequently so it should complete quickly.

Returns
True allows the scan to continue. False terminates the scan as quickly as possible.
void SetNumVersions ( const size_t  numVersions = 3)

This sets the maximum number of patch versions for each new file scanned.

Parameters
numVersionsThe number of versions for each new file scanned to keep in the history. 0 is a special case and will keep an infinite history of changes.
bool Start ( const char *  patchIndexPath,
const char *  patchDataPath,
const std::list< ScanPath::Entry > &  productFiles,
std::vector< size_t > &  idsRemoved,
const size_t  stripProductPath = 0,
const size_t  level = 8 
)

This uses a patch index file and scans the files in a product to generate patch files from the previous versions submitted to this product index.

Parameters
levelThe compression level to use. 10 gives the best compression but is slow and uses more memory. 1 is fast, uses less memory but does not compress as well. The default is 8 giving reasonable performance.