libzypp 17.31.32
VendorAttr.h
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8\---------------------------------------------------------------------*/
11#ifndef ZYPP_VENDORATTR_H
12#define ZYPP_VENDORATTR_H
13
14#include <iosfwd>
15#include <string>
16#include <vector>
17
18#include <zypp/base/PtrTypes.h>
19#include <zypp/IdString.h>
20#include <zypp/PathInfo.h>
21#include <zypp/Vendor.h>
22
23#include <zypp/APIConfig.h> // LEGACY macros
24
26namespace zypp {
28
29 class PoolItem;
30 namespace sat
31 {
32 class Solvable;
33 }
34
61{
62 friend std::ostream & operator<<( std::ostream & str, const VendorAttr & obj );
63
64 public:
66 static const VendorAttr & instance();
67
73
74 public:
76 VendorAttr();
77
79 VendorAttr( const Pathname & initial_r );
80
83
88#if LEGACY(1722)
91#endif
92
96 bool addVendorFile( const Pathname & filename_r );
97#if LEGACY(1722)
100#endif
101
103 typedef std::vector<std::string> VendorList;
104
109 { _addVendorList( std::move(list_r) ); }
114 template <class TContainer>
115 void addVendorList( const TContainer & container_r )
116 {
118 for ( const auto & el : container_r )
119 tmp.push_back( std::string(el) );
120 _addVendorList( std::move(tmp) );
121 }
123 template <class TStr>
124 void addVendorList( const std::initializer_list<TStr> & container_r )
125 {
127 for ( const auto & el : container_r )
128 tmp.push_back( std::string(el) );
129 _addVendorList( std::move(tmp) );
130 }
131
137 bool equivalent( const Vendor & lVendor, const Vendor & rVendor ) const;
143 bool equivalent( const PoolItem & lVendor, const PoolItem & rVendor ) const;
144
146 bool relaxedEquivalent( const Vendor & lVendor, const Vendor & rVendor ) const;
152 bool relaxedEquivalent( const PoolItem & lVendor, const PoolItem & rVendor ) const;
153
154 public:
158 unsigned foreachVendorList( std::function<bool(VendorList)> fnc_r ) const;
159
160 public:
161 class Impl;
163
164#if LEGACY(1722)
166 void _addVendorList( std::vector<std::string> & list_r ) const ZYPP_DEPRECATED;
168 void _addVendorList( std::vector<IdString> && list_r );
169#endif
171};
172
174std::ostream & operator<<( std::ostream & str, const VendorAttr & obj );
175
177}; // namespace zypp
179
180#endif // ZYPP_VENDORATTR_H
RepoManager implementation.
Reference counted access to a Tp object calling a custom Dispose function when the last AutoDispose h...
Definition AutoDispose.h:94
Access to the sat-pools string space.
Definition IdString.h:43
Combining sat::Solvable and ResStatus.
Definition PoolItem.h:51
Definition of vendor equivalence.
Definition VendorAttr.h:61
void addVendorList(const VendorList &list_r)
Definition VendorAttr.h:111
VendorAttr()
Ctor providing the default set.
static VendorAttr & noTargetInstance()
Singleton, settings used if no Target is active.
void addVendorList(const TContainer &container_r)
Definition VendorAttr.h:115
bool equivalent(const Vendor &lVendor, const Vendor &rVendor) const
Return whether two vendor strings should be treated as the same vendor.
bool addVendorFile(const Pathname &filename_r)
Adding new equivalent vendors described in a file.
friend std::ostream & operator<<(std::ostream &str, const VendorAttr &obj)
RWCOW_pointer< Impl > _pimpl
Implementation class.
Definition VendorAttr.h:162
void addVendorList(VendorList &&list_r)
Adding new equivalent vendor strings container.
Definition VendorAttr.h:108
unsigned foreachVendorList(std::function< bool(VendorList)> fnc_r) const
Call fnc_r for each equivalent vendor list (return false to break).
void addVendorList(const std::initializer_list< TStr > &container_r)
Definition VendorAttr.h:124
bool relaxedEquivalent(const Vendor &lVendor, const Vendor &rVendor) const
Like equivalent but always unifies suse and openSUSE vendor.
static const VendorAttr & instance()
(Pseudo)Singleton, mapped to the current Target::vendorAttr settings or to noTargetInstance.
void _addVendorList(VendorList &&list_r)
std::vector< std::string > VendorList
Preferred type to pass equivalent vendor strings.
Definition VendorAttr.h:103
bool addVendorDirectory(const Pathname &dirname_r)
Adding new equivalent vendors described in a directory.
A Solvable object within the sat Pool.
Definition Solvable.h:54
String related utilities and Regular expression matching.
Easy-to use interface to the ZYPP dependency resolver.
std::string Vendor
Definition Vendor.h:22
std::ostream & operator<<(std::ostream &str, const SerialNumber &obj)
#define ZYPP_DEPRECATED
The ZYPP_DEPRECATED macro can be used to trigger compile-time warnings with gcc >= 3....
Definition Globals.h:99