libzypp 17.37.10

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
32 // strings are discarded.
33 class TransferSettings
34 {
35 public:
37 TransferSettings();
38
39 using Headers = std::vector<std::string>;
40
42 void reset();
43
45 void addHeader( std::string && val_r );
46 void addHeader( const std::string & val_r );
47
49 const Headers &headers() const;
50
52 void setUserAgentString( std::string && val_r );
53 void setUserAgentString( const std::string &val_r );
54
56 const std::string &userAgentString() const;
57
58
60 void setUsername( const std::string &val_r );
61 void setUsername( std::string && val_r );
62
64 const std::string &username() const;
65
67 void setPassword( const std::string & val_r );
68 void setPassword( std::string && val_r );
69
71 const std::string &password() const;
72
74 std::string userPassword() const;
75
77 void setAnonymousAuth();
78
79
81 void setProxyEnabled( bool enabled );
82
84 bool proxyEnabled() const;
85
86
88 void setProxy( const std::string &val_r );
89 void setProxy( std::string && val_r );
90
92 const std::string &proxy() const;
93
94
96 void setProxyUsername( const std::string &val_r );
97 void setProxyUsername( std::string && val_r );
98
100 const std::string &proxyUsername() const;
101
103 void setProxyPassword( const std::string &val_r );
104 void setProxyPassword( std::string && val_r );
105
107 const std::string &proxyPassword() const;
108
110 std::string proxyUserPassword() const;
111
112
114 void setConnectTimeout( long t );
115
117 long connectTimeout() const;
118
119
121 void setTimeout( long t );
122
124 long timeout() const;
125
126
128 void setMaxConcurrentConnections(long v);
129
131 long maxConcurrentConnections() const;
132
133
135 void setMinDownloadSpeed(long v);
136
138 long minDownloadSpeed() const;
139
140
142 void setMaxDownloadSpeed(long v);
143
145 long maxDownloadSpeed() const;
146
147
149 void setMaxSilentTries(long v);
150
152 long maxSilentTries() const;
153
154
156 void setVerifyHostEnabled( bool enabled );
157
159 bool verifyHostEnabled() const;
160
161
163 void setVerifyPeerEnabled( bool enabled );
164
166 bool verifyPeerEnabled() const;
167
168
170 void setCertificateAuthoritiesPath( const Pathname &val_r );
171 void setCertificateAuthoritiesPath( Pathname && val_r );
172
174 const Pathname &certificateAuthoritiesPath() const;
175
176
178 void setAuthType( const std::string &val_r );
179 void setAuthType( std::string && val_r );
180
182 const std::string &authType() const;
183
184
186 void setHeadRequestsAllowed(bool allowed);
187
189 bool headRequestsAllowed() const;
190
191
193 void setClientCertificatePath( const Pathname &val_r );
194 void setClientCertificatePath( Pathname && val_r );
195
197 const Pathname &clientCertificatePath() const;
198
199
201 void setClientKeyPath( const Pathname &val_r );
202 void setClientKeyPath( Pathname && val_r );
203
205 const Pathname &clientKeyPath() const;
206
208 void setEnableCookieFile( bool enable = true );
209 bool cookieFileEnabled() const;
210
211 protected:
212 class Impl;
213 RWCOW_pointer<Impl> _impl;
214 };
215
216 } // namespace media
217} // namespece zypp
218
219#endif // ZYPP_CURL_TRANSFER_SETTINGS_H_INCLUDED
zypp::filesystem::Pathname
Pathname.
Definition Pathname.h:47
zypp::media::TransferSettings::Impl
Definition transfersettings.cc:36
zypp::media::TransferSettings::password
const std::string & password() const
auth password
Definition transfersettings.cc:158
zypp::media::TransferSettings::setProxy
void setProxy(const std::string &val_r)
proxy to use if it is enabled
Definition transfersettings.cc:184
zypp::media::TransferSettings::setProxyEnabled
void setProxyEnabled(bool enabled)
whether the proxy is used or not
Definition transfersettings.cc:177
zypp::media::TransferSettings::maxDownloadSpeed
long maxDownloadSpeed() const
Maximum download speed (bytes per second)
Definition transfersettings.cc:253
zypp::media::TransferSettings::TransferSettings
TransferSettings()
Constructs a transfer program cmd line access.
Definition transfersettings.cc:114
zypp::media::TransferSettings::connectTimeout
long connectTimeout() const
connection timeout
Definition transfersettings.cc:232
zypp::media::TransferSettings::authType
const std::string & authType() const
get the allowed authentication types
Definition transfersettings.cc:318
zypp::media::TransferSettings::timeout
long timeout() const
transfer timeout
Definition transfersettings.cc:225
zypp::media::TransferSettings::setUsername
void setUsername(const std::string &val_r)
sets the auth username
Definition transfersettings.cc:143
zypp::media::TransferSettings::reset
void reset()
reset the settings to the defaults
Definition transfersettings.cc:118
zypp::media::TransferSettings::maxSilentTries
long maxSilentTries() const
Maximum silent retries.
Definition transfersettings.cc:260
zypp::media::TransferSettings::clientCertificatePath
const Pathname & clientCertificatePath() const
SSL client certificate file.
Definition transfersettings.cc:283
zypp::media::TransferSettings::userPassword
std::string userPassword() const
returns the user and password as a user:pass string
Definition transfersettings.cc:161
zypp::media::TransferSettings::minDownloadSpeed
long minDownloadSpeed() const
Minimum download speed (bytes per second) until the connection is dropped.
Definition transfersettings.cc:246
zypp::media::TransferSettings::setProxyUsername
void setProxyUsername(const std::string &val_r)
sets the proxy user
Definition transfersettings.cc:194
zypp::media::TransferSettings::setHeadRequestsAllowed
void setHeadRequestsAllowed(bool allowed)
set whether HEAD requests are allowed
Definition transfersettings.cc:322
zypp::media::TransferSettings::headers
const Headers & headers() const
returns a list of all added headers (trimmed)
Definition transfersettings.cc:127
zypp::media::TransferSettings::proxy
const std::string & proxy() const
proxy host
Definition transfersettings.cc:190
zypp::media::TransferSettings::clientKeyPath
const Pathname & clientKeyPath() const
SSL client key file.
Definition transfersettings.cc:293
zypp::media::TransferSettings::setVerifyHostEnabled
void setVerifyHostEnabled(bool enabled)
Sets whether to verify host for ssl.
Definition transfersettings.cc:264
zypp::media::TransferSettings::setUserAgentString
void setUserAgentString(std::string &&val_r)
sets the user agent ie: "Mozilla v3" (trims)
Definition transfersettings.cc:136
zypp::media::TransferSettings::setConnectTimeout
void setConnectTimeout(long t)
set the connect timeout
Definition transfersettings.cc:229
zypp::media::TransferSettings::setClientKeyPath
void setClientKeyPath(const Pathname &val_r)
Sets the SSL client key file.
Definition transfersettings.cc:287
zypp::media::TransferSettings::addHeader
void addHeader(std::string &&val_r)
add a header, on the form "Foo: Bar" (trims)
Definition transfersettings.cc:124
zypp::media::TransferSettings::setMinDownloadSpeed
void setMinDownloadSpeed(long v)
Set minimum download speed (bytes per second) until the connection is dropped.
Definition transfersettings.cc:243
zypp::media::TransferSettings::maxConcurrentConnections
long maxConcurrentConnections() const
Maximum number of concurrent connections for a single transfer.
Definition transfersettings.cc:239
zypp::media::TransferSettings::proxyUserPassword
std::string proxyUserPassword() const
returns the proxy user and password as a user:pass string
Definition transfersettings.cc:212
zypp::media::TransferSettings::setClientCertificatePath
void setClientCertificatePath(const Pathname &val_r)
Sets the SSL client certificate file.
Definition transfersettings.cc:277
zypp::media::TransferSettings::verifyHostEnabled
bool verifyHostEnabled() const
Whether to verify host for ssl.
Definition transfersettings.cc:267
zypp::media::TransferSettings::userAgentString
const std::string & userAgentString() const
user agent string (trimmed)
Definition transfersettings.cc:139
zypp::media::TransferSettings::setPassword
void setPassword(const std::string &val_r)
sets the auth password
Definition transfersettings.cc:152
zypp::media::TransferSettings::headRequestsAllowed
bool headRequestsAllowed() const
whether HEAD requests are allowed
Definition transfersettings.cc:325
zypp::media::TransferSettings::proxyPassword
const std::string & proxyPassword() const
proxy auth password
Definition transfersettings.cc:209
zypp::media::TransferSettings::setVerifyPeerEnabled
void setVerifyPeerEnabled(bool enabled)
Sets whether to verify host for ssl.
Definition transfersettings.cc:271
zypp::media::TransferSettings::cookieFileEnabled
bool cookieFileEnabled() const
Definition transfersettings.cc:299
zypp::media::TransferSettings::proxyEnabled
bool proxyEnabled() const
proxy is enabled
Definition transfersettings.cc:180
zypp::media::TransferSettings::setMaxDownloadSpeed
void setMaxDownloadSpeed(long v)
Set max download speed (bytes per second)
Definition transfersettings.cc:250
zypp::media::TransferSettings::setAnonymousAuth
void setAnonymousAuth()
sets anonymous authentication (ie: for ftp)
Definition transfersettings.cc:170
zypp::media::TransferSettings::Headers
std::vector< std::string > Headers
Definition transfersettings.h:39
zypp::media::TransferSettings::username
const std::string & username() const
auth username
Definition transfersettings.cc:149
zypp::media::TransferSettings::setEnableCookieFile
void setEnableCookieFile(bool enable=true)
Enable or disable the use of the cookie file.
Definition transfersettings.cc:296
zypp::media::TransferSettings::_impl
RWCOW_pointer< Impl > _impl
Definition transfersettings.h:213
zypp::media::TransferSettings::proxyUsername
const std::string & proxyUsername() const
proxy auth username
Definition transfersettings.cc:200
zypp::media::TransferSettings::setAuthType
void setAuthType(const std::string &val_r)
set the allowed authentication types
Definition transfersettings.cc:312
zypp::media::TransferSettings::setCertificateAuthoritiesPath
void setCertificateAuthoritiesPath(const Pathname &val_r)
Sets the SSL certificate authorities path.
Definition transfersettings.cc:302
zypp::media::TransferSettings::setProxyPassword
void setProxyPassword(const std::string &val_r)
sets the proxy password
Definition transfersettings.cc:203
zypp::media::TransferSettings::setMaxConcurrentConnections
void setMaxConcurrentConnections(long v)
Set maximum number of concurrent connections for a single transfer.
Definition transfersettings.cc:236
zypp::media::TransferSettings::certificateAuthoritiesPath
const Pathname & certificateAuthoritiesPath() const
SSL certificate authorities path ( default: /etc/ssl/certs )
Definition transfersettings.cc:308
zypp::media::TransferSettings::setTimeout
void setTimeout(long t)
set the transfer timeout
Definition transfersettings.cc:222
zypp::media::TransferSettings::setMaxSilentTries
void setMaxSilentTries(long v)
Set maximum silent retries.
Definition transfersettings.cc:257
zypp::media::TransferSettings::verifyPeerEnabled
bool verifyPeerEnabled() const
Whether to verify peer for ssl.
Definition transfersettings.cc:274
zypp::media
Definition MediaNetworkRequestExecutor.h:22
zypp
Easy-to use interface to the ZYPP dependency resolver.
Definition Application.cc:20
zypp::RWCOW_pointer
RW_pointer supporting 'copy on write' functionality.
Definition PtrTypes.h:469
Pathname.h
Url.h
Flags.h
PtrTypes.h