ReplicaNet and RNLobby  1
ScanForDiffs.h
1 /* START_LICENSE_HEADER
2 
3 Copyright (C) 2000 Martin Piper, original design and program code
4 Copyright (C) 2001 Replica Software
5 
6 This program file is copyright (C) Replica Software and can only be used under license.
7 For more information visit: http://www.replicanet.com/
8 Or email: info@replicanet.com
9 
10 END_LICENSE_HEADER */
11 #include "RNPlatform/Inc/MemoryTracking.h"
12 #ifndef _SCANFORDIFFS_H_
13 #define _SCANFORDIFFS_H_
14 #include <list>
15 #include <vector>
16 #include "RNLobby/Inc/ScanPath.h"
17 
18 namespace RNReplicaNet
19 {
20 
21 namespace RNLobby
22 {
23 
25 {
26 public:
27  ScanForDiffs();
28  virtual ~ScanForDiffs();
29 
32  void SetNumVersions(const size_t numVersions = 3);
33 
35  size_t GetNumVersions(void);
36 
39  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);
40 
43  virtual bool CallbackScanning(size_t pos,size_t max,const ScanPath::Entry &entry,const size_t filePos,const size_t fileMax);
44 
45  // A small utility function to compress and encrypt a file.
46  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);
47 
48  // A small utility function to decrypt and decompress a file.
49  int DecompressFile(size_t pos,size_t max,const ScanPath::Entry &entry,const char *sourceFile,const char *destinationFile);
50 
51  size_t mNumVersions;
52 };
53 
54 } // namespace RNLobby
55 
56 } // namespace RNReplicaNet
57 
58 #endif
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)
void SetNumVersions(const size_t numVersions=3)
Definition: ScanForDiffs.h:24
An entry in the list updated by ScanPath::Start()
Definition: ScanPath.h:37
size_t GetNumVersions(void)
Gets the value from SetNumVersions().