26 #ifndef FILEDOWNLOAD_H
27 #define FILEDOWNLOAD_H
30 #include <curl/curl.h>
32 #include "string_utils.h"
33 #include "file_utils.h"
101 FileDownload(std::string url, std::string dirName, std::string fileName,
bool progress);
112 FileDownload(std::string fileInfo, std::string url, std::string dirName, std::string fileName, std::string MD5Sum ,
bool progress);
121 FileDownload(std::vector<InfoFile> destinationFiles,
bool progress);
128 curl_slist_free_all(m_slist);
129 curl_global_cleanup();
130 curl_easy_cleanup(m_curl);
149 static int updateProgressHandle(
void *p,
double dltotal,
double dlnow,
double ultotal,
double ulnow);
150 static size_t writeToStreamHandle(
void *buffer,
size_t size,
size_t nmemb,
void *stream);
151 int updateProgress(
void *p,
double dltotal,
double dlnow,
double ultotal,
double ulnow);
152 size_t writeToStream(
void *buffer,
size_t size,
size_t nmemb,
void *stream);
153 void initFileToDownload(std::string _url, std::string _file);
158 bool checkUpToDate();
166 struct curl_slist *m_slist;
170 dwlProgress m_downloadProgress;
173 std::string m_downloadFileName;
174 std::string m_fileInfo;
177 std::string m_MD5Sum;
178 static std::set<FileDownloadEvent*> m_arrCallBacks;