11 #ifndef __DSL_DOWNLOAD_H__
12 #define __DSL_DOWNLOAD_H__
14 #include <drift/rwops.h>
15 #include <drift/sockets3.h>
42 TD_ERROR_CREATING_SOCKET,
43 TD_ERROR_INITIALIZING_LIB,
69 virtual bool SetURL(
const string& url) = 0;
71 virtual void SetUserPass(
const string& user,
const string& pass) = 0;
73 virtual bool Download(
const string& SaveAs);
74 virtual bool Download(FILE * fWriteTo);
87 virtual void SetUserAgent(
const string& ua) = 0;
88 virtual void FollowRedirects(
bool follow) = 0;
91 virtual const char * GetErrorString();
96 string host, path, user_agent;
98 bool followRedirects =
false;
108 virtual bool SetURL(
const string& url);
109 virtual bool GetURL(
string& str);
111 virtual void SetUserPass(
const string& user,
const string& pass);
117 virtual bool Download(
DSL_FILE * fWriteTo);
121 virtual void SetTimeout(uint32 millisec);
122 virtual void SetUserAgent(
const string& ua);
123 virtual void FollowRedirects(
bool follow =
true);
126 #if defined(ENABLE_CURL) || defined(DOXYGEN_SKIP)
127 #include <drift/curl/curl.h>
128 #define DSL_Download DSL_Download_Curl
130 #define DSL_Download DSL_Download_NoCurl
virtual bool Download(DSL_FILE *fWriteTo)=0
virtual void SetTimeout(uint32 millisec)=0
virtual bool Download(const string &SaveAs)
Begin download saving to file SaveAs.
virtual bool Download(FILE *fWriteTo)
Begin download saving to FILE stream.
virtual bool Download(const string &fSaveAs)
Begin download saving to file SaveAs.
bool(* DSL_Download_Callback)(uint64 got, uint64 fullsize, void *user_ptr)