Cdroid/apps/curldownload/curldownload.h

20 lines
534 B
C
Raw Normal View History

2023-04-11 10:53:24 +08:00
#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);
};