libzypp  17.35.8
SysContent.h
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | ____ _ __ __ ___ |
3 | |__ / \ / / . \ . \ |
4 | / / \ V /| _/ _/ |
5 | / /__ | | | | | | |
6 | /_____||_| |_| |_| |
7 | |
8 \---------------------------------------------------------------------*/
12 #ifndef ZYPP_SYSCONTENT_H
13 #define ZYPP_SYSCONTENT_H
14 
15 #include <iosfwd>
16 #include <string>
17 #include <set>
18 
19 #include <zypp/base/PtrTypes.h>
20 
21 #include <zypp/PoolItem.h>
22 #include <zypp/Edition.h>
23 #include <zypp/Date.h>
24 
25 #ifdef YUILogComponent
26 // Work around https://github.com/libyui/libyui/issues/78
27 // The hack here is needed to allow older libyui-qt-pkg building
28 // against current libzypp. Otherwise libyui builds for Code15.4
29 // or older will break.
30 #define BOOST_BIND_GLOBAL_PLACEHOLDERS
31 #include <boost/bind.hpp>
32 #endif
33 
35 namespace zypp
36 {
37  namespace syscontent
39  {
40 
42  //
43  // CLASS NAME : Writer
44  //
65  {
66  using StorageT = std::set<ResObject::constPtr>;
67  public:
68  using value_type = StorageT::value_type;
70  using iterator = StorageT::iterator;
71  using const_iterator = StorageT::const_iterator;
72 
73  public:
75  Writer();
76 
77  public:
83  const std::string & name() const;
84 
86  Writer & name( const std::string & val_r );
87 
89  const Edition & edition() const;
90 
92  Writer & edition( const Edition & val_r );
93 
95  const std::string & description() const;
96 
98  Writer & description( const std::string & val_r );
100 
101  public:
120  void addInstalled( const PoolItem & obj_r );
121 
126  void addIf( const PoolItem & obj_r );
127 
129  void add( const ResObject::constPtr & obj_r );
131 
132  public:
136  bool empty() const;
137 
139  size_type size() const;
140 
142  const_iterator begin() const;
143 
145  const_iterator end() const;
147 
148  public:
152  std::ostream & writeXml( std::ostream & str ) const;
153 
154  private:
155  class Impl;
157  };
159 
161  inline std::ostream & operator<<( std::ostream & str, const Writer & obj )
162  { return obj.writeXml( str ); }
163 
165  //
166  // CLASS NAME : Reader
167  //
172  {
173  public:
175  class Entry;
176 
177  private:
178  using StorageT = std::list<Entry>;
179 
180  public:
181  using value_type = StorageT::value_type;
183  using iterator = StorageT::iterator;
184  using const_iterator = StorageT::const_iterator;
185 
186  public:
188  Reader();
189 
193  Reader( std::istream & input_r );
194 
195  public:
201  const std::string & name() const;
202 
204  const Edition & edition() const;
205 
207  const std::string & description() const;
208 
210  const Date & ctime() const;
211 
212  public:
216  bool empty() const;
217 
219  size_type size() const;
220 
222  const_iterator begin() const;
223 
225  const_iterator end() const;
227 
228  private:
229  class Impl;
231  };
232 
234  std::ostream & operator<<( std::ostream & str, const Reader & obj );
235 
237 
239  //
240  // CLASS NAME : Reader::Entry
241  //
243  class ZYPP_API Reader::Entry
244  {
245  public:
246  Entry();
247  const std::string & kind() const;
248  const std::string & name() const;
249  const Edition & edition() const;
250  const Arch & arch() const;
251  public:
252  class Impl;
253  Entry( const shared_ptr<Impl> & pimpl_r );
254  private:
256  };
258 
260  } // namespace syscontent
263 } // namespace zypp
265 #endif // ZYPP_SYSCONTENT_H
std::ostream & operator<<(std::ostream &str, const Reader &obj)
Definition: SysContent.cc:444
RWCOW_pointer< Impl > _pimpl
Definition: SysContent.h:155
std::ostream & operator<<(std::ostream &str, const Writer &obj)
Definition: SysContent.h:161
Architecture.
Definition: Arch.h:36
String related utilities and Regular expression matching.
Edition represents [epoch:]version[-release]
Definition: Edition.h:60
StorageT::iterator iterator
Definition: SysContent.h:70
std::set< ResObject::constPtr > StorageT
Definition: SysContent.h:66
RWCOW_pointer< Impl > _pimpl
Definition: SysContent.h:229
RW_pointer< Impl > _pimpl
Definition: SysContent.h:255
StorageT::const_iterator const_iterator
Definition: SysContent.h:184
Store and operate on date (time_t).
Definition: Date.h:32
StorageT::size_type size_type
Definition: SysContent.h:182
const Arch Arch_armv7hnl Arch_armv7nhl ZYPP_API
Definition: ResTraits.h:93
std::ostream & writeXml(std::ostream &str) const
Write collected data as XML.
Definition: SysContent.cc:188
TraitsType::constPtrType constPtr
Definition: ResObject.h:43
std::list< Entry > StorageT
Definition: SysContent.h:178
StorageT::value_type value_type
Definition: SysContent.h:68
Combining sat::Solvable and ResStatus.
Definition: PoolItem.h:50
StorageT::size_type size_type
Definition: SysContent.h:69
StorageT::const_iterator const_iterator
Definition: SysContent.h:71
Easy-to use interface to the ZYPP dependency resolver.
Definition: Application.cc:19
SolvableIdType size_type
Definition: PoolMember.h:126
StorageT::value_type value_type
Definition: SysContent.h:181
StorageT::iterator iterator
Definition: SysContent.h:183
xmlTextReader based interface to iterate xml streams.
Definition: Reader.h:95
Collect and serialize a set of ResObject.
Definition: SysContent.h:64