1 /*---------------------------------------------------------------------\
3 | |__ / \ / / . \ . \ |
8 \---------------------------------------------------------------------*/
9 /** \file zypp/VendorAttr.h
12 #ifndef ZYPP_VENDORATTR_H
13 #define ZYPP_VENDORATTR_H
19 #include "zypp/PathInfo.h"
20 #include "zypp/Vendor.h"
22 ///////////////////////////////////////////////////////////////////
24 //////////////////////////////////////////////////////////////////
26 /** Definition of vendor equivalence.
28 * Packages with equivalment vendor strings may replace themself without
29 * creating a solver error.
31 * Per default vendor strings starting with \c "suse' or \c 'opensuse"
32 * are treated equivalent. This may be changed by providing customized
33 * vendor description files in \c /etc/zypp/vendors.d.
38 typedef std::vector<std::string> VendorList;
41 static const VendorAttr & instance();
44 * Adding new equivalent vendors described in a directory
46 bool addVendorDirectory( const Pathname & dirname ) const;
49 * Adding new equivalent vendors described in a file
51 bool addVendorFile( const Pathname & filename ) const;
54 * Adding new equivalent vendor set from list
56 template <class _Iterator>
57 void addVendorList( _Iterator begin, _Iterator end ) const
58 { VendorList tmp( begin, end ); _addVendorList( tmp ); }
60 /** Return whether two vendor strings shold be treated as the same vendor.
61 * Usually the solver is allowed to automatically select a package of an
62 * equivalent vendor when updating. Replacing a package with one of a
63 * different vendor usually must be confirmed by the user.
65 bool equivalent( const Vendor & lVendor, const Vendor & rVendor ) const;
69 void _addVendorList( VendorList & ) const;
72 /** \relates VendorAttr Stream output */
73 std::ostream & operator<<( std::ostream & str, const VendorAttr & obj );
75 ///////////////////////////////////////////////////////////////////
77 ///////////////////////////////////////////////////////////////////
79 #endif // ZYPP_VENDORATTR_H