libzypp  17.14.0
SolvableSpec.h
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | ____ _ __ __ ___ |
3 | |__ / \ / / . \ . \ |
4 | / / \ V /| _/ _/ |
5 | / /__ | | | | | | |
6 | /_____||_| |_| |_| |
7 | |
8 \---------------------------------------------------------------------*/
11 #ifndef ZYPP_SAT_SOLVABLESPEC_H
12 #define ZYPP_SAT_SOLVABLESPEC_H
13 
14 #include <iosfwd>
15 
16 #include "zypp/APIConfig.h"
17 #include "zypp/base/PtrTypes.h"
18 #include "zypp/base/InputStream.h"
19 #include "zypp/base/String.h"
20 
21 #include "zypp/sat/SolvableType.h"
22 
24 namespace zypp
25 {
27  namespace sat
28  {
45  {
46  public:
48  SolvableSpec();
49 
51  ~SolvableSpec();
52 
53  public:
55  void addIdent( IdString ident_r );
56 
58  void addProvides( Capability provides_r );
59 
60  public:
62  void parse( const C_Str & spec_r );
63 
65  void parseFrom( const InputStream & istr_r );
66 
68  template <class TIterator>
69  void parseFrom( TIterator begin, TIterator end )
70  { for_( it, begin, end ) parse( *it ); }
71 
73  void splitParseFrom( const C_Str & multispec_r );
74 
75  public:
81  bool contains( const sat::Solvable & solv_r ) const;
83  template <class Derived>
84  bool contains( const SolvableType<Derived> & solv_r ) const
85  { return contains( solv_r.satSolvable() ); }
86 
88  bool dirty() const;
89 
95  void setDirty() const;
96 
97  public:
99  bool containsIdent( const IdString & ident_r ) const;
100 
102  bool containsProvides( const Capability & provides_r ) const;
103 
104  public:
105  class Impl;
106  private:
108  friend std::ostream & operator<<( std::ostream & str, const SolvableSpec & obj );
109  };
110 
112  std::ostream & operator<<( std::ostream & str, const SolvableSpec & obj );
113 
114  } // namespace sat
116 } // namespace zypp
118 #endif // ZYPP_SAT_SOLVABLESPEC_H