00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef _SCANFORDIFFS_H_
00012 #define _SCANFORDIFFS_H_
00013 #include "RNPlatform/Inc/DLLExportAPI.h"
00014 #include <list>
00015 #include <vector>
00016 #include "RNLobby/Inc/ScanPath.h"
00017
00018 namespace RNReplicaNet
00019 {
00020
00021 namespace RNLobby
00022 {
00023
00024 class ScanForDiffs
00025 {
00026 public:
00027 ScanForDiffs();
00028 virtual ~ScanForDiffs();
00029
00032 void SetNumVersions(const size_t numVersions = 3);
00033
00035 size_t GetNumVersions(void);
00036
00039 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);
00040
00043 virtual bool CallbackScanning(size_t pos,size_t max,const ScanPath::Entry &entry,const size_t filePos,const size_t fileMax);
00044
00045 private:
00046 friend class ProductPatcher;
00047
00048 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 = 1024*1024);
00049
00050 int DecompressFile(size_t pos,size_t max,const ScanPath::Entry &entry,const char *sourceFile,const char *destinationFile);
00051
00052 size_t mNumVersions;
00053 };
00054
00055 }
00056
00057 }
00058
00059 #endif