SLikeNet 0.1.3

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DirectoryDeltaTransfer.h
Go to the documentation of this file.
1 /*
2 * Original work: Copyright (c) 2014, Oculus VR, Inc.
3 * All rights reserved.
4 *
5 * This source code is licensed under the BSD-style license found in the
6 * RakNet License.txt file in the licenses directory of this source tree. An additional grant
7 * of patent rights can be found in the RakNet Patents.txt file in the same directory.
8 *
9 *
10 * Modified work: Copyright (c) 2017, SLikeSoft UG (haftungsbeschränkt)
11 *
12 * This source code was modified by SLikeSoft. Modifications are licensed under the MIT-style
13 * license found in the license.txt file in the root directory of this source tree.
14 */
15
20
21
22 #include "NativeFeatureIncludes.h"
23 #if _RAKNET_SUPPORT_DirectoryDeltaTransfer==1 && _RAKNET_SUPPORT_FileOperations==1
24
25 #ifndef __DIRECTORY_DELTA_TRANSFER_H
26 #define __DIRECTORY_DELTA_TRANSFER_H
27
28 #include "memoryoverride.h"
29 #include "types.h"
30 #include "Export.h"
31 #include "PluginInterface2.h"
32 #include "DS_Map.h"
33 #include "PacketPriority.h"
34
39
55
56 namespace SLNet
57 {
59 class RakPeerInterface;
60 class FileList;
61 struct Packet;
62 struct InternalPacket;
63 struct DownloadRequest;
64 class FileListTransfer;
65 class FileListTransferCBInterface;
66 class FileListProgress;
67 class IncrementalReadInterface;
68
69 class RAK_DLL_EXPORT DirectoryDeltaTransfer : public PluginInterface2
70 {
71 public:
72 // GetInstance() and DestroyInstance(instance*)
73 STATIC_FACTORY_DECLARATIONS(DirectoryDeltaTransfer)
74
75 // Constructor
76 DirectoryDeltaTransfer();
77
78 // Destructor
79 virtual ~DirectoryDeltaTransfer();
80
84 void SetFileListTransferPlugin(FileListTransfer *flt);
85
88 void SetApplicationDirectory(const char *pathToApplication);
89
93 void SetUploadSendParameters(PacketPriority _priority, char _orderingChannel);
94
100 void AddUploadsFromSubdirectory(const char *subdir);
101
118 unsigned short DownloadFromSubdirectory(const char *subdir, const char *outputSubdir, bool prependAppDirToOutputSubdir, SystemAddress host, FileListTransferCBInterface *onFileCallback, PacketPriority _priority, char _orderingChannel, FileListProgress *cb);
119
137 unsigned short DownloadFromSubdirectory(FileList &localFiles, const char *subdir, const char *outputSubdir, bool prependAppDirToOutputSubdir, SystemAddress host, FileListTransferCBInterface *onFileCallback, PacketPriority _priority, char _orderingChannel, FileListProgress *cb);
138
144 void GenerateHashes(FileList &localFiles, const char *outputSubdir, bool prependAppDirToOutputSubdir);
145
147 void ClearUploads(void);
148
151 unsigned GetNumberOfFilesForUpload(void) const;
152
157 void SetDownloadRequestIncrementalReadInterface(IncrementalReadInterface *_incrementalReadInterface, unsigned int _chunkSize);
158
160 virtual PluginReceiveResult OnReceive(Packet *packet);
161 protected:
162 void OnDownloadRequest(Packet *packet);
163
164 char applicationDirectory[512];
165 FileListTransfer *fileListTransfer;
166 FileList *availableUploads;
167 PacketPriority priority;
168 char orderingChannel;
169 IncrementalReadInterface *incrementalReadInterface;
170 unsigned int chunkSize;
171 };
172
173 } // namespace SLNet
174
175 #endif
176
177 #endif // _RAKNET_SUPPORT_*