libzypp 17.25.10
TransferSettings.h
Go to the documentation of this file.
1 
2 #ifndef TRANSFER_SETTINGS_H_
3 #define TRANSFER_SETTINGS_H_
4 
5 #include <string>
6 #include <vector>
7 #include <zypp/base/Flags.h>
8 #include <zypp/base/PtrTypes.h>
9 #include <zypp/Pathname.h>
10 #include <zypp/Url.h>
11 
12 namespace zypp
13 {
14  namespace media
15  {
16 
21  {
22  public:
25 
26  typedef std::vector<std::string> Headers;
27 
29  void reset();
30 
31 
33  void addHeader( std::string && val_r );
34 
36  Headers::const_iterator headersBegin() const;
37 
39  Headers::const_iterator headersEnd() const;
40 
41 
43  void setUserAgentString( std::string && val_r );
44 
46  std::string userAgentString() const;
47 
48 
50  void setUsername( std::string && val_r );
51 
53  std::string username() const;
54 
56  void setPassword( std::string && val_r );
57 
59  std::string password() const;
60 
62  std::string userPassword() const;
63 
65  void setAnonymousAuth();
66 
67 
69  void setProxyEnabled( bool enabled );
70 
72  bool proxyEnabled() const;
73 
74 
76  void setProxy( std::string && val_r );
77 
79  std::string proxy() const;
80 
81 
83  void setProxyUsername( std::string && val_r );
84 
86  std::string proxyUsername() const;
87 
89  void setProxyPassword( std::string && val_r );
90 
92  std::string proxyPassword() const;
93 
95  std::string proxyUserPassword() const;
96 
97 
99  void setConnectTimeout( long t );
100 
102  long connectTimeout() const;
103 
104 
106  void setTimeout( long t );
107 
109  long timeout() const;
110 
111 
113  void setMaxConcurrentConnections(long v);
114 
116  long maxConcurrentConnections() const;
117 
118 
120  void setMinDownloadSpeed(long v);
121 
123  long minDownloadSpeed() const;
124 
125 
127  void setMaxDownloadSpeed(long v);
128 
130  long maxDownloadSpeed() const;
131 
132 
134  void setMaxSilentTries(long v);
135 
137  long maxSilentTries() const;
138 
139 
141  void setVerifyHostEnabled( bool enabled );
142 
144  bool verifyHostEnabled() const;
145 
146 
148  void setVerifyPeerEnabled( bool enabled );
149 
151  bool verifyPeerEnabled() const;
152 
153 
155  void setCertificateAuthoritiesPath( Pathname && val_r );
156 
159 
160 
162  void setAuthType( std::string && val_r );
163 
165  std::string authType() const;
166 
167 
169  void setHeadRequestsAllowed(bool allowed);
170 
172  bool headRequestsAllowed() const;
173 
174 
176  void setClientCertificatePath( Pathname && val_r );
177 
180 
181 
183  void setClientKeyPath( Pathname && val_r );
184 
186  Pathname clientKeyPath() const;
187 
188  protected:
189  class Impl;
191  };
192 
193  } // namespace media
194 } // namespece zypp
195 
196 #endif
Holds transfer setting.
std::string proxy() const
proxy host
void setProxyEnabled(bool enabled)
whether the proxy is used or not
long maxDownloadSpeed() const
Maximum download speed (bytes per second)
TransferSettings()
Constructs a transfer program cmd line access.
void setProxyUsername(std::string &&val_r)
sets the proxy user
long connectTimeout() const
connection timeout
std::string password() const
auth password
long timeout() const
transfer timeout
Headers::const_iterator headersEnd() const
end iterators to additional headers
std::string proxyPassword() const
proxy auth password
void setClientCertificatePath(Pathname &&val_r)
Sets the SSL client certificate file.
void setProxy(std::string &&val_r)
proxy to use if it is enabled
void reset()
reset the settings to the defaults
long maxSilentTries() const
Maximum silent retries.
std::string userPassword() const
returns the user and password as a user:pass string
long minDownloadSpeed() const
Minimum download speed (bytes per second) until the connection is dropped.
void setHeadRequestsAllowed(bool allowed)
set whether HEAD requests are allowed
void setAuthType(std::string &&val_r)
set the allowed authentication types
void setUsername(std::string &&val_r)
sets the auth username
void setVerifyHostEnabled(bool enabled)
Sets whether to verify host for ssl.
void setUserAgentString(std::string &&val_r)
sets the user agent ie: "Mozilla v3"
void setConnectTimeout(long t)
set the connect timeout
std::string userAgentString() const
user agent string
void setPassword(std::string &&val_r)
sets the auth password
void setCertificateAuthoritiesPath(Pathname &&val_r)
Sets the SSL certificate authorities path.
void addHeader(std::string &&val_r)
add a header, on the form "Foo: Bar"
void setMinDownloadSpeed(long v)
Set minimum download speed (bytes per second) until the connection is dropped.
long maxConcurrentConnections() const
Maximum number of concurrent connections for a single transfer.
std::string proxyUserPassword() const
returns the proxy user and password as a user:pass string
bool verifyHostEnabled() const
Whether to verify host for ssl.
void setClientKeyPath(Pathname &&val_r)
Sets the SSL client key file.
Pathname clientCertificatePath() const
SSL client certificate file.
void setProxyPassword(std::string &&val_r)
sets the proxy password
Pathname certificateAuthoritiesPath() const
SSL certificate authorities path ( default: /etc/ssl/certs )
bool headRequestsAllowed() const
whether HEAD requests are allowed
std::string proxyUsername() const
proxy auth username
std::string authType() const
get the allowed authentication types
void setVerifyPeerEnabled(bool enabled)
Sets whether to verify host for ssl.
bool proxyEnabled() const
proxy is enabled
void setMaxDownloadSpeed(long v)
Set max download speed (bytes per second)
std::string username() const
auth username
void setAnonymousAuth()
sets anonymous authentication (ie: for ftp)
std::vector< std::string > Headers
RWCOW_pointer< Impl > _impl
void setMaxConcurrentConnections(long v)
Set maximum number of concurrent connections for a single transfer.
Pathname clientKeyPath() const
SSL client key file.
void setTimeout(long t)
set the transfer timeout
void setMaxSilentTries(long v)
Set maximum silent retries.
Headers::const_iterator headersBegin() const
begin iterators to additional headers
bool verifyPeerEnabled() const
Whether to verify peer for ssl.
Easy-to use interface to the ZYPP dependency resolver.
Definition: CodePitfalls.doc:2
RW_pointer supporting 'copy on write' functionality.
Definition: PtrTypes.h:459