ScanChecksum.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 _SCANCHECKSUM_H_
00012 #define _SCANCHECKSUM_H_
00013 #include "RNPlatform/Inc/DLLExportAPI.h"
00014 #include <string>
00015 #include <list>
00016 #include <stddef.h>
00017 // MPi: TODO: Make cross platform
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 &currentEntry,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 } // namespace RNLobby
00073 
00074 } // namespace RNReplicaNet
00075 
00076 #endif

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