libzypp 17.37.10

proxyinfo.cc
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8\---------------------------------------------------------------------*/
12
13#include "proxyinfo.h"
14#include <iostream>
15#include <utility>
16
17#include <zypp/base/Logger.h>
18
19#include "proxyinfo/proxyinfoimpl.h"
20#include "proxyinfo/proxyinfos.h"
21
22 using namespace zypp::base;
23
24 namespace zypp {
25 namespace media {
26
27 shared_ptr<ProxyInfo::Impl> ProxyInfo::Impl::_nullimpl;
28
29 ProxyInfo::ProxyInfo()
30#ifdef WITH_LIBPROXY_SUPPORT
31 : _pimpl( (ProxyInfoLibproxy::isAvailabe() ? static_cast<Impl *>(new ProxyInfoLibproxy()) : static_cast<Impl *>(new ProxyInfoSysconfig("proxy"))) )
32#else
33 : _pimpl( new ProxyInfoSysconfig("proxy") )
34#endif
35 {}
36
37 ProxyInfo::ProxyInfo(ProxyInfo::ImplPtr pimpl_r)
38 : _pimpl(std::move(pimpl_r))
39 {}
40
41 bool ProxyInfo::enabled() const
42 { return _pimpl->enabled(); }
43
44 std::string ProxyInfo::proxy(const Url & url_r) const
45 { return _pimpl->proxy(url_r); }
46
47 ProxyInfo::NoProxyList ProxyInfo::noProxy() const
48 { return _pimpl->noProxy(); }
49
50 ProxyInfo::NoProxyIterator ProxyInfo::noProxyBegin() const
51 { return _pimpl->noProxyBegin(); }
52
53 ProxyInfo::NoProxyIterator ProxyInfo::noProxyEnd() const
54 { return _pimpl->noProxyEnd(); }
55
56 bool ProxyInfo::useProxyFor( const Url & url_r ) const
57 { return _pimpl->useProxyFor( url_r ); }
58
59 } // namespace media
60} // namespace zypp
zypp::Url
Url manipulation class.
Definition Url.h:93
zypp::media::ProxyInfoLibproxy
Definition proxyinfolibproxy.h:40
zypp::media::ProxyInfoLibproxy::isAvailabe
static bool isAvailabe()
Definition proxyinfolibproxy.cc:179
zypp::media::ProxyInfoSysconfig
Definition proxyinfosysconfig.h:28
zypp::media::ProxyInfo::noProxy
NoProxyList noProxy() const
Definition proxyinfo.cc:47
zypp::media::ProxyInfo::useProxyFor
bool useProxyFor(const Url &url_r) const
Return true if enabled and url_r does not match noProxy.
Definition proxyinfo.cc:56
zypp::media::ProxyInfo::proxy
std::string proxy(const Url &url) const
Definition proxyinfo.cc:44
zypp::media::ProxyInfo::NoProxyList
std::list< std::string > NoProxyList
Definition proxyinfo.h:34
zypp::media::ProxyInfo::_pimpl
RW_pointer< Impl > _pimpl
Pointer to implementation.
Definition proxyinfo.h:57
zypp::media::ProxyInfo::noProxyEnd
NoProxyIterator noProxyEnd() const
Definition proxyinfo.cc:53
zypp::media::ProxyInfo::NoProxyIterator
std::list< std::string >::const_iterator NoProxyIterator
Definition proxyinfo.h:35
zypp::media::ProxyInfo::ProxyInfo
ProxyInfo()
Default Ctor: guess the best available implementation.
Definition proxyinfo.cc:29
zypp::media::ProxyInfo::ImplPtr
shared_ptr< Impl > ImplPtr
Definition proxyinfo.h:39
zypp::media::ProxyInfo::enabled
bool enabled() const
Definition proxyinfo.cc:41
zypp::media::ProxyInfo::noProxyBegin
NoProxyIterator noProxyBegin() const
Definition proxyinfo.cc:50
std
Definition Arch.h:364
zypp::base
Definition Random.cc:7
zypp::media
Definition MediaNetworkRequestExecutor.h:22
zypp
Easy-to use interface to the ZYPP dependency resolver.
Definition Application.cc:20
proxyinfo.h
proxyinfoimpl.h
proxyinfos.h
zypp::media::ProxyInfo::Impl
Definition proxyinfoimpl.h:26
zypp::media::ProxyInfo::Impl::_nullimpl
static shared_ptr< Impl > _nullimpl
Default Impl: empty sets.
Definition proxyinfoimpl.h:75
Logger.h