mirror of
https://gitee.com/houstudio/Cdroid.git
synced 2024-12-05 05:37:53 +08:00
20 lines
534 B
C
20 lines
534 B
C
|
#pragma once
|
||
|
#include <curl/curl.h>
|
||
|
#include <string>
|
||
|
|
||
|
class CurlDownloader{
|
||
|
private:
|
||
|
int mTimerFD;
|
||
|
CURLM *mMultiHandle;
|
||
|
static int SocketCallback(CURL *easy, curl_socket_t s, int action, void *userp, void *socketp);
|
||
|
static int PollCallback(int fd, int events, void*data);
|
||
|
static int TimerFDCallback(int fd, int events, void* data);
|
||
|
static int StartTimeoutCallback(CURLM *multi, long timeout_ms, void * data);
|
||
|
public:
|
||
|
CurlDownloader();
|
||
|
~CurlDownloader();
|
||
|
int addUrl(const std::string&url);
|
||
|
};
|
||
|
|
||
|
|