00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef _SCANCHECKSUM_H_
00012 #define _SCANCHECKSUM_H_
00013 #include "RNPlatform/Inc/DLLExportAPI.h"
00014 #include <string>
00015 #include <list>
00016 #include <stddef.h>
00017
00018 #include <windows.h>
00019 #include "RNPlatform/Inc/ThreadClass.h"
00020 #include "RNPlatform/Inc/Thread.h"
00021 #include "RNLobby/Inc/ScanPath.h"
00022
00023 namespace RNReplicaNet
00024 {
00025
00026 namespace RNLobby
00027 {
00028
00030 class ScanChecksum : private ThreadClass , private Thread
00031 {
00032 public:
00033 ScanChecksum();
00034 virtual ~ScanChecksum();
00035
00036
00042 bool Start(std::list<ScanPath::Entry> &paths,const bool multiThread = false,const size_t chunkSize = 1024*1024);
00043
00044 bool Start(ScanPath::Entry &entry,const size_t chunkSize = 1024*1024);
00045
00048 bool Stop(void);
00049
00052 bool GetCompleted(void);
00053
00056 virtual bool CallbackUpdate(const size_t numFiles,const ScanPath::Entry ¤tEntry,const size_t currentBytesScanned);
00057
00059 virtual void CallbackComplete(void);
00060
00061 private:
00062
00063 int ThreadEntry(void);
00064 int RealThreadEntry(std::list<ScanPath::Entry> &paths,const size_t chunkSize);
00065
00066 std::list<ScanPath::Entry> *mPaths;
00067 size_t mChunkSize;
00068 FILE *mFP;
00069 void *mBuffer;
00070 };
00071
00072 }
00073
00074 }
00075
00076 #endif