libzypp  15.28.6
VendorAttr.h
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | ____ _ __ __ ___ |
3 | |__ / \ / / . \ . \ |
4 | / / \ V /| _/ _/ |
5 | / /__ | | | | | | |
6 | /_____||_| |_| |_| |
7 | |
8 \---------------------------------------------------------------------*/
12 #ifndef ZYPP_VENDORATTR_H
13 #define ZYPP_VENDORATTR_H
14 
15 #include <iosfwd>
16 #include <string>
17 #include <vector>
18 
19 #include "zypp/PathInfo.h"
20 #include "zypp/Vendor.h"
21 
23 namespace zypp {
25 
26  class PoolItem;
27  namespace sat
28  {
29  class Solvable;
30  }
31 
44 {
45  public:
46  typedef std::vector<std::string> VendorList;
47 
49  static const VendorAttr & instance();
50 
54  bool addVendorDirectory( const Pathname & dirname ) const;
55 
59  bool addVendorFile( const Pathname & filename ) const;
60 
64  template <class TIterator>
65  void addVendorList( TIterator begin, TIterator end ) const
66  { VendorList tmp( begin, end ); _addVendorList( tmp ); }
67 
73  bool equivalent( const Vendor & lVendor, const Vendor & rVendor ) const;
75  bool equivalent( IdString lVendor, IdString rVendor ) const;
77  bool equivalent( sat::Solvable lVendor, sat::Solvable rVendor ) const;
79  bool equivalent( const PoolItem & lVendor, const PoolItem & rVendor ) const;
80 
81  private:
82  VendorAttr();
83  void _addVendorList( VendorList & ) const;
84 };
85 
87 std::ostream & operator<<( std::ostream & str, const VendorAttr & obj );
88 
90 }; // namespace zypp
92 
93 #endif // ZYPP_VENDORATTR_H
A Solvable object within the sat Pool.
Definition: Solvable.h:53
std::vector< std::string > VendorList
Definition: VendorAttr.h:46
std::string Vendor
Definition: Vendor.h:22
Access to the sat-pools string space.
Definition: IdString.h:41
bool equivalent(const Vendor &lVendor, const Vendor &rVendor) const
Return whether two vendor strings shold be treated as the same vendor.
Definition: VendorAttr.cc:285
std::ostream & operator<<(std::ostream &str, const Exception &obj)
Definition: Exception.cc:120
Definition of vendor equivalence.
Definition: VendorAttr.h:43
bool addVendorDirectory(const Pathname &dirname) const
Adding new equivalent vendors described in a directory.
Definition: VendorAttr.cc:254
void _addVendorList(VendorList &) const
Definition: VendorAttr.cc:169
void addVendorList(TIterator begin, TIterator end) const
Adding new equivalent vendor set from list.
Definition: VendorAttr.h:65
Combining sat::Solvable and ResStatus.
Definition: PoolItem.h:50
static const VendorAttr & instance()
Singleton.
Definition: VendorAttr.cc:123
bool addVendorFile(const Pathname &filename) const
Adding new equivalent vendors described in a file.
Definition: VendorAttr.cc:211