libzypp 17.34.0
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
72 static VendorAttr & noTargetInstance();
73
74 public:
76 VendorAttr();
77
79 VendorAttr( const Pathname & initial_r );
80
83
84 VendorAttr(const VendorAttr &) = default;
86 VendorAttr &operator=(const VendorAttr &) = default;
88
92 bool addVendorDirectory( const Pathname & dirname_r );
93#if LEGACY(1722)
95 bool addVendorDirectory( const Pathname & dirname_r ) const ZYPP_DEPRECATED;
96#endif
97
101 bool addVendorFile( const Pathname & filename_r );
102#if LEGACY(1722)
104 bool addVendorFile( const Pathname & filename_r ) const ZYPP_DEPRECATED;
105#endif
106
108 using VendorList = std::vector<std::string>;
109
114 { _addVendorList( std::move(list_r) ); }
117 { _addVendorList( VendorList(list_r) ); }
119 template <class TContainer>
120 void addVendorList( const TContainer & container_r )
121 {
123 for ( const auto & el : container_r )
124 tmp.push_back( std::string(el) );
125 _addVendorList( std::move(tmp) );
126 }
128 template <class TStr>
129 void addVendorList( const std::initializer_list<TStr> & container_r )
130 {
132 for ( const auto & el : container_r )
133 tmp.push_back( std::string(el) );
134 _addVendorList( std::move(tmp) );
135 }
136
142 bool equivalent( const Vendor & lVendor, const Vendor & rVendor ) const;
144 bool equivalent( IdString lVendor, IdString rVendor ) const;
146 bool equivalent( sat::Solvable lVendor, sat::Solvable rVendor ) const;
148 bool equivalent( const PoolItem & lVendor, const PoolItem & rVendor ) const;
149
151 bool relaxedEquivalent( const Vendor & lVendor, const Vendor & rVendor ) const;
153 bool relaxedEquivalent( IdString lVendor, IdString rVendor ) const;
155 bool relaxedEquivalent( sat::Solvable lVendor, sat::Solvable rVendor ) const;
157 bool relaxedEquivalent( const PoolItem & lVendor, const PoolItem & rVendor ) const;
158
159 public:
163 unsigned foreachVendorList( std::function<bool(VendorList)> fnc_r ) const;
164
165 public:
166 class Impl;
168
169#if LEGACY(1722)
171 void _addVendorList( std::vector<std::string> & list_r ) const ZYPP_DEPRECATED;
173 void _addVendorList( std::vector<IdString> && list_r );
174#endif
175 void _addVendorList( VendorList && list_r );
176};
177
179std::ostream & operator<<( std::ostream & str, const VendorAttr & obj ) ZYPP_API;
180
182}; // namespace zypp
184
185#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:95
Access to the sat-pools string space.
Definition IdString.h:44
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:116
void addVendorList(const TContainer &container_r)
Definition VendorAttr.h:120
std::vector< std::string > VendorList
Preferred type to pass equivalent vendor strings.
Definition VendorAttr.h:108
RWCOW_pointer< Impl > _pimpl
Implementation class.
Definition VendorAttr.h:167
VendorAttr(VendorAttr &&) noexcept=default
void addVendorList(VendorList &&list_r)
Adding new equivalent vendor strings container.
Definition VendorAttr.h:113
VendorAttr(const VendorAttr &)=default
void addVendorList(const std::initializer_list< TStr > &container_r)
Definition VendorAttr.h:129
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::ostream & operator<<(std::ostream &str, const SerialNumber &obj)
const Arch Arch_armv7hnl Arch_armv7nhl ZYPP_API
Definition Arch.h:247
std::string Vendor
Definition Vendor.h:22
#define ZYPP_DEPRECATED
The ZYPP_DEPRECATED macro can be used to trigger compile-time warnings with gcc >= 3....
Definition Globals.h:106