changing ostream::operator<< breaks testsuite. reverted.
[platform/upstream/libzypp.git] / zypp / VendorAttr.h
1 /*---------------------------------------------------------------------\
2 |                          ____ _   __ __ ___                          |
3 |                         |__  / \ / / . \ . \                         |
4 |                           / / \ V /|  _/  _/                         |
5 |                          / /__ | | | | | |                           |
6 |                         /_____||_| |_| |_|                           |
7 |                                                                      |
8 \---------------------------------------------------------------------*/
9 /** \file zypp/VendorAttr.h
10  *
11 */
12 #ifndef ZYPP_VENDORATTR_H
13 #define ZYPP_VENDORATTR_H
14
15 #include <iosfwd>
16 #include <string>
17
18 #include "zypp/base/NonCopyable.h"
19 #include "zypp/NeedAType.h"
20
21 ///////////////////////////////////////////////////////////////////
22 namespace zypp {
23 //////////////////////////////////////////////////////////////////
24
25 class VendorAttr : private base::NonCopyable
26 {
27   public:
28     /** Singleton */
29     static const VendorAttr & instance();
30
31     /** Enable autoprotection of foreign vendor packages.
32      * This is the default.
33      * \note This will \b not change the status of already
34      * loaded pool items.
35     */
36     static void enableAutoProtect();
37     /** Disable autoprotection of foreign vendor packages.
38      * Autoprotection is on per defult.
39      * \note This will \b not change the status of already
40      * loaded pool items.
41     */
42     static void disableAutoProtect();
43
44     /**
45      * Return whether it's a known vendor
46      **/
47     bool isKnown( const Vendor & vendor_r ) const;
48
49     /**
50      * Return whether this vendors packages should be
51      * protected by default.
52      **/
53     bool autoProtect( const Vendor & vendor_r ) const;
54
55     /** Return whether two vendor strings shold be treated as the same vendor.
56      * Usually the solver is allowed to automatically select a package of an
57      * equivalent vendor when updating. Replacing a package with one of a
58      * different vendor usually must be confirmed by the user.
59     */
60     bool equivalent( const Vendor & lhs, const Vendor & rhs ) const;
61
62   private:
63     VendorAttr();
64 };
65
66 ///////////////////////////////////////////////////////////////////
67 }; // namespace zypp
68 ///////////////////////////////////////////////////////////////////
69
70 #endif // ZYPP_VENDORATTR_H