1 /*---------------------------------------------------------------------\
3 | |__ / \ / / . \ . \ |
8 \---------------------------------------------------------------------*/
9 /** \file zypp/media/MediaCurl.h
12 #ifndef ZYPP_MEDIA_MEDIACURL_H
13 #define ZYPP_MEDIA_MEDIACURL_H
15 #include "zypp/media/MediaHandler.h"
16 #include "zypp/ZYppCallbacks.h"
18 #include <curl/curl.h>
23 ///////////////////////////////////////////////////////////////////
25 // CLASS NAME : MediaCurl
27 * @short Implementation class for FTP, HTTP and HTTPS MediaHandler
30 class MediaCurl : public MediaHandler {
37 * \throws MediaException
40 virtual void disconnectFrom();
43 * \throws MediaException
46 virtual void getFileCopy( const Pathname & srcFilename, const Pathname & targetFilename) const;
50 * \throws MediaException
53 virtual void doGetFileCopy( const Pathname & srcFilename, const Pathname & targetFilename, callback::SendReport<DownloadProgressReport> & _report) const;
56 virtual bool checkAttachPoint(const Pathname &apoint) const;
60 MediaCurl( const Url & url_r,
61 const Pathname & attach_point_hint_r );
63 virtual ~MediaCurl() { try { release(); } catch(...) {} }
65 static void setCookieFile( const Pathname & );
70 virtual ~Callbacks() {}
71 virtual bool progress( int percent ) = 0;
76 static int progressCallback( void *clientp, double dltotal, double dlnow,
77 double ultotal, double ulnow );
81 char _curlError[ CURL_ERROR_SIZE ];
86 std::string _proxyuserpwd;
87 std::string _currentCookieFile;
91 static Pathname _cookieFile;
92 static std::string _agent;
95 ///////////////////////////////////////////////////////////////////
100 #endif // ZYPP_MEDIA_MEDIACURL_H