-
Notifications
You must be signed in to change notification settings - Fork 0
/
SendFolderThread.h
65 lines (48 loc) · 3.15 KB
/
SendFolderThread.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
//----------------------------------------------------------------------------//
// *** МНОГОПОТОЧНАЯ КРОССПЛАТФОРМЕННАЯ СИСТЕМА ОБМЕНА ДАННЫМИ *** //
// //
// Файл SendFolderThread.h //
// //
// *** TSENDFOLDERTHREAD ПОТОК ОТПРАВКИ КАТАЛОГА ПО ЛОКАЛЬНОЙ СЕТИ *** //
// //
// Автор ГЛУЩЕНКО Сергей //
// //
// Москва //
//----------------------------------------------------------------------------//
#ifndef SENDFOLDERTHREAD_H
#define SENDFOLDERTHREAD_H
#include <QUuid>
#include <thread>
#include "CheckSum.h"
#include "NetSendThread.h"
#include "ZIPThread.h"
#include "File.h"
#include "SendPartFileThread.h"
class TSendFolderThread : public TNetSendThread
{
Q_OBJECT
private:
QString TempCatalog; //Каталог временных файлов
QString CatPathName; //Путь и имя каталога, отправляемого по локальной сети
QString _GUID; //Генерируется заново в рабочем методе потока, используется для формирования имени временного ZIP-файла
QString FilePathName; //Временный ZIP-файл, представляющий собой архив отправляемого каталога
QString MD5; //Контрольная сумма временного ZIP-файла, представляющего собой архив отправляемого каталога
long long FileSize; //Размер временного ZIP-файла, представляющего собой архив отправляемого каталога
TZIPThread ZIP; //Поток-архиватор
int QProc; //Количество доступных в ОС процессоров
std::vector<TSendPartFileThread*> Parts; //Массив потоков передачи файла по частям
//Очищает массив Parts
void ClearParts(void);
public:
TSendFolderThread(void);
~TSendFolderThread(void);
//Рабочий метод потока
void run(void);
//Устанавливает каталог временных файлов
void SetTempCatalog(QString _TempCatalog);
//Передает внутрь потока данные, необходимые для отправки каталога по локальной сети
// На вход подаются:
// - путь и имя каталога, отправляемого по локальной сети
void SendFolder(QString _CatPathName);
};
#endif