-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathHTTP.h
55 lines (43 loc) · 1.3 KB
/
HTTP.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
#ifndef HTTP_H
#define HTTP_H
#include <QString>
#include <QObject>
#include <QThread>
#include <QRunnable>
#include <QDebug>
//#define CURL_STATICLIB
#include "curllib\curl.h"
static QString crtPath;
class HTTP : public QObject, public QRunnable
{
Q_OBJECT
public:
HTTP(QString URL,QString Path,QObject *parent);
~HTTP();
int httpDownLoad(QString URL,QString Path);
static size_t write_data(void *ptr,
size_t size,
size_t nmemb,
void *stream
);
static int progress_callback(void *clientp,
curl_off_t dltotal,
curl_off_t dlnow, curl_off_t ultotal,
curl_off_t ulnow
);
protected:
void run();
private:
QString turl;
QString tdlpath;
void *tid;
FILE *pagefile;
CURL *handle;
private slots:
signals:
void tworkMessageBox(int tag,QString title,QString txt,bool modal = false);
void dldone();
};
void httpcrt();
QString conver(LONG64 l);
#endif // HTTP_H