ScanForDiffs.h

00001 /* START_LICENSE_HEADER
00002 
00003 Copyright (C) 2000 Martin Piper, original design and program code
00004 Copyright (C) 2001 Replica Software
00005 
00006 This program file is copyright (C) Replica Software and can only be used under license.
00007 For more information visit: http://www.replicanet.com/
00008 Or email: info@replicanet.com
00009 
00010 END_LICENSE_HEADER */
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     // A small utility function to compress and encrypt a file
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 } // namespace RNLobby
00056 
00057 } // namespace RNReplicaNet
00058 
00059 #endif

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