libzypp  17.31.8
transfersettings.h
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | ____ _ __ __ ___ |
3 | |__ / \ / / . \ . \ |
4 | / / \ V /| _/ _/ |
5 | / /__ | | | | | | |
6 | /_____||_| |_| |_| |
7 | |
8 \---------------------------------------------------------------------*/
12 #ifndef ZYPP_CURL_TRANSFER_SETTINGS_H_INCLUDED
13 #define ZYPP_CURL_TRANSFER_SETTINGS_H_INCLUDED
14 
15 #include <string>
16 #include <vector>
17 #include <zypp-core/base/Flags.h>
18 #include <zypp-core/base/PtrTypes.h>
19 #include <zypp-core/Pathname.h>
20 #include <zypp-core/Url.h>
21 namespace zypp
22 {
23  namespace media
24  {
25 
30  {
31  public:
34 
35  typedef std::vector<std::string> Headers;
36 
38  void reset();
39 
41  void addHeader( std::string && val_r );
42  void addHeader( const std::string & val_r );
43 
45  const Headers &headers() const;
46 
48  void setUserAgentString( std::string && val_r );
49  void setUserAgentString( const std::string && val_r );
50 
52  const std::string &userAgentString() const;
53 
54 
56  void setUsername( const std::string &val_r );
57  void setUsername( std::string && val_r );
58 
60  const std::string &username() const;
61 
63  void setPassword( const std::string & val_r );
64  void setPassword( std::string && val_r );
65 
67  const std::string &password() const;
68 
70  std::string userPassword() const;
71 
73  void setAnonymousAuth();
74 
75 
77  void setProxyEnabled( bool enabled );
78 
80  bool proxyEnabled() const;
81 
82 
84  void setProxy( const std::string &val_r );
85  void setProxy( std::string && val_r );
86 
88  const std::string &proxy() const;
89 
90 
92  void setProxyUsername( const std::string &val_r );
93  void setProxyUsername( std::string && val_r );
94 
96  const std::string &proxyUsername() const;
97 
99  void setProxyPassword( const std::string &val_r );
100  void setProxyPassword( std::string && val_r );
101 
103  const std::string &proxyPassword() const;
104 
106  std::string proxyUserPassword() const;
107 
108 
110  void setConnectTimeout( long t );
111 
113  long connectTimeout() const;
114 
115 
117  void setTimeout( long t );
118 
120  long timeout() const;
121 
122 
124  void setMaxConcurrentConnections(long v);
125 
127  long maxConcurrentConnections() const;
128 
129 
131  void setMinDownloadSpeed(long v);
132 
134  long minDownloadSpeed() const;
135 
136 
138  void setMaxDownloadSpeed(long v);
139 
141  long maxDownloadSpeed() const;
142 
143 
145  void setMaxSilentTries(long v);
146 
148  long maxSilentTries() const;
149 
150 
152  void setVerifyHostEnabled( bool enabled );
153 
155  bool verifyHostEnabled() const;
156 
157 
159  void setVerifyPeerEnabled( bool enabled );
160 
162  bool verifyPeerEnabled() const;
163 
164 
166  void setCertificateAuthoritiesPath( const Pathname &val_r );
167  void setCertificateAuthoritiesPath( Pathname && val_r );
168 
170  const Pathname &certificateAuthoritiesPath() const;
171 
172 
174  void setAuthType( const std::string &val_r );
175  void setAuthType( std::string && val_r );
176 
178  const std::string &authType() const;
179 
180 
182  void setHeadRequestsAllowed(bool allowed);
183 
185  bool headRequestsAllowed() const;
186 
187 
189  void setClientCertificatePath( const Pathname &val_r );
190  void setClientCertificatePath( Pathname && val_r );
191 
193  const Pathname &clientCertificatePath() const;
194 
195 
197  void setClientKeyPath( const Pathname &val_r );
198  void setClientKeyPath( Pathname && val_r );
199 
201  const Pathname &clientKeyPath() const;
202 
203  protected:
204  class Impl;
206  };
207 
208  } // namespace media
209 } // namespece zypp
210 
211 #endif // ZYPP_CURL_TRANSFER_SETTINGS_H_INCLUDED
long timeout() const
transfer timeout
const Pathname & certificateAuthoritiesPath() const
SSL certificate authorities path ( default: /etc/ssl/certs )
const Pathname & clientCertificatePath() const
SSL client certificate file.
void addHeader(std::string &&val_r)
add a header, on the form "Foo: Bar"
std::string proxyUserPassword() const
returns the proxy user and password as a user:pass string
const std::string & proxyPassword() const
proxy auth password
void setPassword(const std::string &val_r)
sets the auth password
long maxDownloadSpeed() const
Maximum download speed (bytes per second)
Holds transfer setting.
const std::string & authType() const
get the allowed authentication types
bool verifyHostEnabled() const
Whether to verify host for ssl.
const std::string & proxyUsername() const
proxy auth username
void setUsername(const std::string &val_r)
sets the auth username
void setHeadRequestsAllowed(bool allowed)
set whether HEAD requests are allowed
void setConnectTimeout(long t)
set the connect timeout
const std::string & password() const
auth password
const std::string & username() const
auth username
const Headers & headers() const
returns a list of all added headers
void setAnonymousAuth()
sets anonymous authentication (ie: for ftp)
bool verifyPeerEnabled() const
Whether to verify peer for ssl.
long maxSilentTries() const
Maximum silent retries.
void setAuthType(const std::string &val_r)
set the allowed authentication types
void setProxy(const std::string &val_r)
proxy to use if it is enabled
long connectTimeout() const
connection timeout
std::vector< std::string > Headers
TransferSettings()
Constructs a transfer program cmd line access.
void setMaxSilentTries(long v)
Set maximum silent retries.
void setTimeout(long t)
set the transfer timeout
const Pathname & clientKeyPath() const
SSL client key file.
RWCOW_pointer< Impl > _impl
void setMaxDownloadSpeed(long v)
Set max download speed (bytes per second)
long minDownloadSpeed() const
Minimum download speed (bytes per second) until the connection is dropped.
bool proxyEnabled() const
proxy is enabled
void setProxyPassword(const std::string &val_r)
sets the proxy password
void reset()
reset the settings to the defaults
void setMaxConcurrentConnections(long v)
Set maximum number of concurrent connections for a single transfer.
long maxConcurrentConnections() const
Maximum number of concurrent connections for a single transfer.
void setUserAgentString(std::string &&val_r)
sets the user agent ie: "Mozilla v3"
void setClientCertificatePath(const Pathname &val_r)
Sets the SSL client certificate file.
void setProxyUsername(const std::string &val_r)
sets the proxy user
std::string userPassword() const
returns the user and password as a user:pass string
void setCertificateAuthoritiesPath(const Pathname &val_r)
Sets the SSL certificate authorities path.
Easy-to use interface to the ZYPP dependency resolver.
Definition: CodePitfalls.doc:1
void setMinDownloadSpeed(long v)
Set minimum download speed (bytes per second) until the connection is dropped.
const std::string & proxy() const
proxy host
void setVerifyPeerEnabled(bool enabled)
Sets whether to verify host for ssl.
void setClientKeyPath(const Pathname &val_r)
Sets the SSL client key file.
void setVerifyHostEnabled(bool enabled)
Sets whether to verify host for ssl.
const std::string & userAgentString() const
user agent string
bool headRequestsAllowed() const
whether HEAD requests are allowed
void setProxyEnabled(bool enabled)
whether the proxy is used or not