libzypp  17.36.3
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>
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 
40  {
41  public:
44  ~ProxyInfoLibproxy() override;
45 
46  static bool isAvailabe();
47 
49  bool enabled() const override
50  { return _enabled; }
52  std::string proxy(const Url & url_r) const override;
55  { return _no_proxy; }
59  ProxyInfo::NoProxyIterator noProxyEnd() const override;
60  private:
64  };
65 
67 
68  } // namespace media
69 } // namespace zypp
70 
71 #endif // ZYPP_MEDIA_PROXYINFO_PROXYINFOLIBPROXY_H
std::string proxy(const Url &url_r) const override
char **(*)(ProxyFactoryType *self, const char *url) GetProxiesSig
std::list< std::string >::const_iterator NoProxyIterator
Definition: proxyinfo.h:35
ProxyInfo::NoProxyList noProxy() const override
void(*)(ProxyFactoryType *self) DelFactorySig
DefaultIntegral< bool, false > _enabled
ProxyInfo::NoProxyList _no_proxy
ProxyInfo::NoProxyIterator noProxyEnd() const override
struct _pxProxyFactory pxProxyFactoryType
std::list< std::string > NoProxyList
Definition: proxyinfo.h:34
ProxyInfo::NoProxyIterator noProxyBegin() const override
ProxyFactoryType *(*)(void) CreateFactorySig
void(*)(char **proxies) FreeProxiesCb
Easy-to use interface to the ZYPP dependency resolver.
Definition: Application.cc:19
bool enabled() const override
Url manipulation class.
Definition: Url.h:92