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;
59 MediaCurl( const Url & url_r,
60 const Pathname & attach_point_hint_r );
62 virtual ~MediaCurl() { try { release(); } catch(...) {} }
64 static void setCookieFile( const Pathname & );
69 virtual ~Callbacks() {}
70 virtual bool progress( int percent ) = 0;
75 static int progressCallback( void *clientp, double dltotal, double dlnow,
76 double ultotal, double ulnow );
80 char _curlError[ CURL_ERROR_SIZE ];
84 std::string _proxyuserpwd;
85 std::string _currentCookieFile;
87 static Pathname _cookieFile;
91 static bool _globalInit;
94 ///////////////////////////////////////////////////////////////////
99 #endif // ZYPP_MEDIA_MEDIACURL_H