TransferSettings.h

Go to the documentation of this file.
00001 
00002 #ifndef TRANSFER_SETTINGS_H_
00003 #define TRANSFER_SETTINGS_H_
00004 
00005 #include <string>
00006 #include <vector>
00007 #include "zypp/base/Flags.h"
00008 #include "zypp/base/PtrTypes.h"
00009 #include "zypp/Pathname.h"
00010 #include "zypp/Url.h"
00011 
00012 namespace zypp
00013 {
00014 namespace media
00015 {
00016 
00020 class TransferSettings
00021 {
00022 public:
00026   TransferSettings();
00027 
00033   TransferSettings( const zypp::Url &url );
00034 
00035   typedef std::vector<std::string> Headers;
00036 
00040   void reset();
00041 
00045   void addHeader( const std::string &header );
00046 
00050   Headers::const_iterator headersBegin() const;
00051 
00055   Headers::const_iterator headersEnd() const;
00056 
00060   void setUserAgentString( const std::string &agent );
00061 
00065   std::string userAgentString() const;
00066 
00070   void setUsername( const std::string &username );
00071 
00075   std::string username() const;
00076 
00080   void setPassword( const std::string &password );
00081 
00085   std::string password() const;
00086 
00091   std::string userPassword() const;
00092 
00096   void setAnonymousAuth();
00097 
00101   void setProxyEnabled( bool enabled );
00102 
00106   bool proxyEnabled() const;
00107 
00111   void setProxy( const std::string &proxyhost );
00112 
00116   std::string proxy() const;
00117 
00121   void setProxyUsername( const std::string &proxyuser );
00122 
00126   std::string proxyUsername() const;
00127 
00131   void setProxyPassword( const std::string &proxypass );
00132 
00136   std::string proxyPassword() const;
00137 
00142   std::string proxyUserPassword() const;
00143 
00147   void setConnectTimeout( long t );
00148 
00152   long connectTimeout() const;
00153 
00157   void setTimeout( long t );
00158 
00162   long timeout() const;
00163 
00167   long maxConcurrentConnections() const;
00168 
00172   void setMaxConcurrentConnections(long v);
00173 
00178   long minDownloadSpeed() const;
00179   
00184   void setMinDownloadSpeed(long v);
00185 
00189   long maxDownloadSpeed() const;
00190 
00194   void setMaxDownloadSpeed(long v);
00195 
00199   long maxSilentTries() const;
00200 
00204   void setMaxSilentTries(long v);
00205 
00209   bool verifyHostEnabled() const;
00210 
00214   void setVerifyHostEnabled( bool enabled );
00215 
00219   bool verifyPeerEnabled() const;
00220 
00224   void setVerifyPeerEnabled( bool enabled );
00225 
00230   Pathname certificateAuthoritiesPath() const;
00231 
00235   void setCertificateAuthoritiesPath( const zypp::Pathname &path );
00236 
00240   void setAuthType( const std::string &authtype );
00241 
00245   std::string authType() const;
00246 
00250   void setHeadRequestsAllowed(bool allowed);
00251 
00255   bool headRequestsAllowed() const;
00256 
00257 protected:
00258   class Impl;
00259   RWCOW_pointer<Impl> _impl;
00260 };
00261 
00262 } // ns media
00263 } // ns zypp
00264 
00265 #endif

doxygen