libzypp 17.28.8
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
12namespace zypp::proto {
13 class TransferSettings;
14}
15
16namespace zypp
17{
18 namespace media
19 {
20
25 {
26 public:
29
30 TransferSettings( const zypp::proto::TransferSettings &settings );
31
32 typedef std::vector<std::string> Headers;
33
35 void reset();
36
37
39 void addHeader( std::string && val_r );
40
42 Headers headers() const;
43
45 void setUserAgentString( std::string && val_r );
46
48 std::string userAgentString() const;
49
50
52 void setUsername( std::string && val_r );
53
55 std::string username() const;
56
58 void setPassword( std::string && val_r );
59
61 std::string password() const;
62
64 std::string userPassword() const;
65
67 void setAnonymousAuth();
68
69
71 void setProxyEnabled( bool enabled );
72
74 bool proxyEnabled() const;
75
76
78 void setProxy( std::string && val_r );
79
81 std::string proxy() const;
82
83
85 void setProxyUsername( std::string && val_r );
86
88 std::string proxyUsername() const;
89
91 void setProxyPassword( std::string && val_r );
92
94 std::string proxyPassword() const;
95
97 std::string proxyUserPassword() const;
98
99
101 void setConnectTimeout( long t );
102
104 long connectTimeout() const;
105
106
108 void setTimeout( long t );
109
111 long timeout() const;
112
113
115 void setMaxConcurrentConnections(long v);
116
118 long maxConcurrentConnections() const;
119
120
122 void setMinDownloadSpeed(long v);
123
125 long minDownloadSpeed() const;
126
127
129 void setMaxDownloadSpeed(long v);
130
132 long maxDownloadSpeed() const;
133
134
136 void setMaxSilentTries(long v);
137
139 long maxSilentTries() const;
140
141
143 void setVerifyHostEnabled( bool enabled );
144
146 bool verifyHostEnabled() const;
147
148
150 void setVerifyPeerEnabled( bool enabled );
151
153 bool verifyPeerEnabled() const;
154
155
158
161
162
164 void setAuthType( std::string && val_r );
165
167 std::string authType() const;
168
169
171 void setHeadRequestsAllowed(bool allowed);
172
174 bool headRequestsAllowed() const;
175
176
178 void setClientCertificatePath( Pathname && val_r );
179
182
183
185 void setClientKeyPath( Pathname && val_r );
186
188 Pathname clientKeyPath() const;
189
190 const zypp::proto::TransferSettings &protoData() const;
191 zypp::proto::TransferSettings &protoData();
192
193 protected:
194 class Impl;
196 };
197
198 } // namespace media
199} // namespece zypp
200
201#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
std::string proxyPassword() const
proxy auth password
void setClientCertificatePath(Pathname &&val_r)
Sets the SSL client certificate file.
const zypp::proto::TransferSettings & protoData() const
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
TransferSettings(const zypp::proto::TransferSettings &settings)
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
Headers headers() const
returns a list of all added headers
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.
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