Shadowrun: Awakened 29 September 2011 - Build 871
DirectoryDeltaTransfer.h
Go to the documentation of this file.
00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 #include "NativeFeatureIncludes.h"
00010 #if _RAKNET_SUPPORT_DirectoryDeltaTransfer==1 && _RAKNET_SUPPORT_FileOperations==1
00011 
00012 #ifndef __DIRECTORY_DELTA_TRANSFER_H
00013 #define __DIRECTORY_DELTA_TRANSFER_H
00014 
00015 #include "RakMemoryOverride.h"
00016 #include "RakNetTypes.h"
00017 #include "Export.h"
00018 #include "PluginInterface2.h"
00019 #include "DS_Map.h"
00020 #include "PacketPriority.h"
00021 
00026 
00042 
00043 namespace RakNet
00044 {
00046 class RakPeerInterface;
00047 class FileList;
00048 struct Packet;
00049 struct InternalPacket;
00050 struct DownloadRequest;
00051 class FileListTransfer;
00052 class FileListTransferCBInterface;
00053 class FileListProgress;
00054 class IncrementalReadInterface;
00055 
00056 class RAK_DLL_EXPORT DirectoryDeltaTransfer : public PluginInterface2
00057 {
00058 public:
00059     // GetInstance() and DestroyInstance(instance*)
00060     STATIC_FACTORY_DECLARATIONS(DirectoryDeltaTransfer)
00061 
00062     // Constructor
00063     DirectoryDeltaTransfer();
00064 
00065     // Destructor
00066     virtual ~DirectoryDeltaTransfer();
00067 
00071     void SetFileListTransferPlugin(FileListTransfer *flt);
00072 
00075     void SetApplicationDirectory(const char *pathToApplication);
00076 
00080     void SetUploadSendParameters(PacketPriority _priority, char _orderingChannel);
00081 
00087     void AddUploadsFromSubdirectory(const char *subdir);
00088 
00104     unsigned short DownloadFromSubdirectory(const char *subdir, const char *outputSubdir, bool prependAppDirToOutputSubdir, SystemAddress host, FileListTransferCBInterface *onFileCallback, PacketPriority _priority, char _orderingChannel, FileListProgress *cb);
00105 
00107     void ClearUploads(void);
00108 
00111     unsigned GetNumberOfFilesForUpload(void) const;
00112 
00117     void SetDownloadRequestIncrementalReadInterface(IncrementalReadInterface *_incrementalReadInterface, unsigned int _chunkSize);
00118     
00120     virtual PluginReceiveResult OnReceive(Packet *packet);
00121 protected:
00122     void OnDownloadRequest(Packet *packet);
00123 
00124     char applicationDirectory[512];
00125     FileListTransfer *fileListTransfer;
00126     FileList *availableUploads;
00127     PacketPriority priority;
00128     char orderingChannel;
00129     IncrementalReadInterface *incrementalReadInterface;
00130     unsigned int chunkSize;
00131 };
00132 
00133 } // namespace RakNet
00134 
00135 #endif
00136 
00137 #endif // _RAKNET_SUPPORT_*

Copyright © 2007-2010 by The Shadowrun: Awakened Team. This work is licensed under the GNU Lesser General Public License 3.

GNU Lesser General Public License 3 Sourceforge.net