Bump to 17.31.23
[platform/upstream/libzypp.git] / zypp-curl / proxyinfo.h
1 /*---------------------------------------------------------------------\
2 |                          ____ _   __ __ ___                          |
3 |                         |__  / \ / / . \ . \                         |
4 |                           / / \ V /|  _/  _/                         |
5 |                          / /__ | | | | | |                           |
6 |                         /_____||_| |_| |_|                           |
7 |                                                                      |
8 \---------------------------------------------------------------------*/
9 /** \file zypp-curl/ProxyInfo
10  *
11 */
12 #ifndef ZYPP_CURL_PROXYINFO_H_INCLUDED
13 #define ZYPP_CURL_PROXYINFO_H_INCLUDED
14
15 #include <string>
16 #include <list>
17
18 #include <zypp-core/base/PtrTypes.h>
19
20 namespace zypp {
21
22   class Url;
23
24   namespace media {
25
26     ///////////////////////////////////////////////////////////////////
27     //
28     //  CLASS NAME : ProxyInfo
29     class ProxyInfo
30     {
31     public:
32       typedef intrusive_ptr<ProxyInfo> Ptr;
33       typedef intrusive_ptr<ProxyInfo> constPtr;
34       typedef std::list<std::string> NoProxyList;
35       typedef std::list<std::string>::const_iterator NoProxyIterator;
36
37       /** Implementation */
38       struct Impl;
39       typedef shared_ptr<Impl> ImplPtr;
40
41       /** Default Ctor: guess the best available implementation. */
42       ProxyInfo();
43       /** Ctor taking a specific implementation. */
44       ProxyInfo( ProxyInfo::ImplPtr pimpl_r );
45
46       bool enabled() const;
47       std::string proxy(const Url & url) const;
48       NoProxyList noProxy() const;
49       NoProxyIterator noProxyBegin() const;
50       NoProxyIterator noProxyEnd() const;
51
52       /** Return \c true if  \ref enabled and \a url_r does not match \ref noProxy. */
53       bool useProxyFor( const Url & url_r ) const;
54
55     private:
56       /** Pointer to implementation */
57       RW_pointer<Impl> _pimpl;
58     };
59
60
61 ///////////////////////////////////////////////////////////////////
62
63   } // namespace media
64 } // namespace zypp
65
66 #endif // ZYPP_CURL_PROXYINFO_H_INCLUDED