libzypp  17.14.0
Product.h
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | ____ _ __ __ ___ |
3 | |__ / \ / / . \ . \ |
4 | / / \ V /| _/ _/ |
5 | / /__ | | | | | | |
6 | /_____||_| |_| |_| |
7 | |
8 \---------------------------------------------------------------------*/
12 #ifndef ZYPP_PRODUCT_H
13 #define ZYPP_PRODUCT_H
14 
15 #include <list>
16 #include <string>
17 
18 #include "zypp/ResObject.h"
19 
21 namespace zypp
22 {
23 
24  DEFINE_PTR_TYPE(Product);
25 
27  //
28  // CLASS NAME : Product
29  //
32  class Product : public ResObject
33  {
34  public:
35  typedef Product Self;
39 
40  public:
45 
49  std::string referenceFilename() const;
50 
69  CapabilitySet droplist() const;
70 
71  public:
72  /***/
73  typedef std::vector<constPtr> ReplacedProducts;
74 
79 
81  std::string productLine() const;
82 
83  public:
85  std::string shortName() const;
86 
88  std::string flavor() const;
89 
95  std::string type() const;
96 
98  std::list<std::string> flags() const;
99 
104  Date endOfLife() const;
105 
111  bool hasEndOfLife() const;
117  bool hasEndOfLife( Date & value ) const;
118 
120  std::vector<Repository::ContentIdentifier> updateContentIdentifier() const;
121 
123  bool hasUpdateContentIdentifier( const Repository::ContentIdentifier & cident_r ) const;
124 
126  template <class TIterator>
127  bool hasUpdateContentIdentifier( TIterator begin, TIterator end ) const
128  {
129  for_( it, begin, end )
130  if ( hasUpdateContentIdentifier( *it ) )
131  return true;
132  return false;
133  }
134 
135  public:
139  bool isTargetDistribution() const;
140 
144  std::string registerTarget() const;
145 
149  std::string registerRelease() const;
150 
154  std::string registerFlavor() const;
155 
156  public:
157  /***/
158  class UrlList;
159 
166  UrlList urls( const std::string & key_r ) const;
167 
169  UrlList releaseNotesUrls() const;
170 
172  UrlList registerUrls() const;
173 
175  UrlList smoltUrls() const;
176 
181  UrlList updateUrls() const;
182 
187  UrlList extraUrls() const;
188 
194  UrlList optionalUrls() const;
195 
196  protected:
197  friend Ptr make<Self>( const sat::Solvable & solvable_r );
199  Product( const sat::Solvable & solvable_r );
201  virtual ~Product();
202  };
203 
209  {
210  private:
212  typedef std::list<Url> ListType;
213 
214  public:
215  typedef ListType::value_type value_type;
217  typedef ListType::const_iterator const_iterator;
218 
219  bool empty() const
220  { return _list.empty(); }
221 
222  size_type size() const
223  { return _list.size(); }
224 
226  { return _list.begin(); }
227 
229  { return _list.end(); }
230 
232  Url first() const
233  { return empty() ? value_type() : _list.front(); }
234 
235  public:
237  std::string key() const
238  { return _key; }
239 
240  private:
241  friend class Product;
243  std::string _key;
245  };
246 
248  std::ostream & operator<<( std::ostream & str, const Product::UrlList & obj );
249 
251 } // namespace zypp
253 #endif // ZYPP_PRODUCT_H