libzypp 17.37.10

proxyinfolibproxy.h
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8\---------------------------------------------------------------------*/
12#ifndef ZYPP_MEDIA_PROXYINFO_PROXYINFOLIBPROXY_H
13#define ZYPP_MEDIA_PROXYINFO_PROXYINFOLIBPROXY_H
14
15#include <string>
16
17#include <zypp-core/base/DefaultIntegral>
18#include <zypp-curl/ProxyInfo>
19#include <zypp-curl/proxyinfo/proxyinfoimpl.h>
20
21 extern "C" {
22 typedef struct _pxProxyFactory pxProxyFactoryType;
23}
24
25 namespace zypp {
26 namespace media {
27
28 template <typename ProxyFactoryType>
29 using CreateFactorySig = ProxyFactoryType *(*) (void);
30
31 template <typename ProxyFactoryType>
32 using DelFactorySig = void (*) (ProxyFactoryType *self);
33
34 template <typename ProxyFactoryType>
35 using GetProxiesSig = char **(*) (ProxyFactoryType *self, const char *url);
36
37 using FreeProxiesCb = void (*) (char **proxies);
38
39 class ProxyInfoLibproxy : public ProxyInfo::Impl
40 {
41 public:
42 ProxyInfoLibproxy();
44 ~ProxyInfoLibproxy() override;
45
46 static bool isAvailabe();
47
49 bool enabled() const override
50 { return _enabled; }
51
52 std::string proxy(const Url & url_r) const override;
54 ProxyInfo::NoProxyList noProxy() const override
55 { return _no_proxy; }
56
57 ProxyInfo::NoProxyIterator noProxyBegin() const override;
59 ProxyInfo::NoProxyIterator noProxyEnd() const override;
60 private:
61 DefaultIntegral<bool,false> _enabled;
62 ProxyInfo::NoProxyList _no_proxy;
63 pxProxyFactoryType *_factory;
64 };
65
67
68 } // namespace media
69} // namespace zypp
70
71#endif // ZYPP_MEDIA_PROXYINFO_PROXYINFOLIBPROXY_H
zypp::DefaultIntegral
Integral type with defined initial value when default constructed.
Definition defaultintegral.h:42
zypp::Url
Url manipulation class.
Definition Url.h:93
zypp::media::ProxyInfoLibproxy::_enabled
DefaultIntegral< bool, false > _enabled
Definition proxyinfolibproxy.h:61
zypp::media::ProxyInfoLibproxy::_factory
pxProxyFactoryType * _factory
Definition proxyinfolibproxy.h:63
zypp::media::ProxyInfoLibproxy::noProxyBegin
ProxyInfo::NoProxyIterator noProxyBegin() const override
Definition proxyinfolibproxy.cc:222
zypp::media::ProxyInfoLibproxy::~ProxyInfoLibproxy
~ProxyInfoLibproxy() override
Definition proxyinfolibproxy.cc:176
zypp::media::ProxyInfoLibproxy::enabled
bool enabled() const override
Definition proxyinfolibproxy.h:49
zypp::media::ProxyInfoLibproxy::ProxyInfoLibproxy
ProxyInfoLibproxy()
Definition proxyinfolibproxy.cc:169
zypp::media::ProxyInfoLibproxy::noProxy
ProxyInfo::NoProxyList noProxy() const override
Definition proxyinfolibproxy.h:54
zypp::media::ProxyInfoLibproxy::proxy
std::string proxy(const Url &url_r) const override
Definition proxyinfolibproxy.cc:184
zypp::media::ProxyInfoLibproxy::noProxyEnd
ProxyInfo::NoProxyIterator noProxyEnd() const override
Definition proxyinfolibproxy.cc:225
zypp::media::ProxyInfoLibproxy::_no_proxy
ProxyInfo::NoProxyList _no_proxy
Definition proxyinfolibproxy.h:62
zypp::media::ProxyInfoLibproxy::isAvailabe
static bool isAvailabe()
Definition proxyinfolibproxy.cc:179
zypp::media::ProxyInfo::NoProxyList
std::list< std::string > NoProxyList
Definition proxyinfo.h:34
zypp::media::ProxyInfo::NoProxyIterator
std::list< std::string >::const_iterator NoProxyIterator
Definition proxyinfo.h:35
zypp::media
Definition MediaNetworkRequestExecutor.h:22
zypp::media::GetProxiesSig
char **(*)(ProxyFactoryType *self, const char *url) GetProxiesSig
Definition proxyinfolibproxy.h:35
zypp::media::DelFactorySig
void(*)(ProxyFactoryType *self) DelFactorySig
Definition proxyinfolibproxy.h:32
zypp::media::FreeProxiesCb
void(*)(char **proxies) FreeProxiesCb
Definition proxyinfolibproxy.h:37
zypp::media::CreateFactorySig
ProxyFactoryType *(*)(void) CreateFactorySig
Definition proxyinfolibproxy.h:29
zypp::url
Url details namespace.
Definition UrlBase.cc:58
zypp
Easy-to use interface to the ZYPP dependency resolver.
Definition Application.cc:20
proxyinfoimpl.h
pxProxyFactoryType
struct _pxProxyFactory pxProxyFactoryType
Definition proxyinfolibproxy.h:22
zypp::media::ProxyInfo::Impl
Definition proxyinfoimpl.h:26