libzypp  10.5.0
VendorAttr.h
Go to the documentation of this file.
00001 /*---------------------------------------------------------------------\
00002 |                          ____ _   __ __ ___                          |
00003 |                         |__  / \ / / . \ . \                         |
00004 |                           / / \ V /|  _/  _/                         |
00005 |                          / /__ | | | | | |                           |
00006 |                         /_____||_| |_| |_|                           |
00007 |                                                                      |
00008 \---------------------------------------------------------------------*/
00012 #ifndef ZYPP_VENDORATTR_H
00013 #define ZYPP_VENDORATTR_H
00014 
00015 #include <iosfwd>
00016 #include <string>
00017 #include <vector>
00018 
00019 #include "zypp/PathInfo.h"
00020 #include "zypp/Vendor.h"
00021 
00023 namespace zypp {
00025 
00026   class PoolItem;
00027   namespace sat
00028   {
00029     class Solvable;
00030   }
00031 
00043 class VendorAttr
00044 {
00045   public:
00046     typedef std::vector<std::string> VendorList;
00047 
00049     static const VendorAttr & instance();
00050 
00054     bool addVendorDirectory( const Pathname & dirname ) const;
00055 
00059     bool addVendorFile( const Pathname & filename ) const;
00060 
00064     template <class _Iterator>
00065     void addVendorList( _Iterator begin, _Iterator end ) const
00066     { VendorList tmp( begin, end ); _addVendorList( tmp ); }
00067 
00073     bool equivalent( const Vendor & lVendor, const Vendor & rVendor ) const;
00075     bool equivalent( IdString lVendor, IdString rVendor ) const;
00077     bool equivalent( sat::Solvable lVendor, sat::Solvable rVendor ) const;
00079     bool equivalent( const PoolItem & lVendor, const PoolItem & rVendor ) const;
00080 
00081   private:
00082     VendorAttr();
00083     void _addVendorList( VendorList & ) const;
00084 };
00085 
00087 std::ostream & operator<<( std::ostream & str, const VendorAttr & obj );
00088 
00090 }; // namespace zypp
00092 
00093 #endif // ZYPP_VENDORATTR_H