libzypp  11.13.5
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 
26 namespace zypp
27 {
28 
29  namespace syscontent
30  {
31 
33  //
34  // CLASS NAME : Writer
35  //
55  class Writer
56  {
57  typedef std::set<ResObject::constPtr> StorageT;
58  public:
59  typedef StorageT::value_type value_type;
61  typedef StorageT::iterator iterator;
62  typedef StorageT::const_iterator const_iterator;
63 
64  public:
66  Writer();
67 
68  public:
74  const std::string & name() const;
75 
77  Writer & name( const std::string & val_r );
78 
80  const Edition & edition() const;
81 
83  Writer & edition( const Edition & val_r );
84 
86  const std::string & description() const;
87 
89  Writer & description( const std::string & val_r );
91 
92  public:
111  void addInstalled( const PoolItem & obj_r );
112 
117  void addIf( const PoolItem & obj_r );
118 
120  void add( const ResObject::constPtr & obj_r );
122 
123  public:
127  bool empty() const;
128 
130  size_type size() const;
131 
133  const_iterator begin() const;
134 
136  const_iterator end() const;
138 
139  public:
143  std::ostream & writeXml( std::ostream & str ) const;
144 
145  private:
146  class Impl;
148  };
150 
152  inline std::ostream & operator<<( std::ostream & str, const Writer & obj )
153  { return obj.writeXml( str ); }
154 
156  //
157  // CLASS NAME : Reader
158  //
162  class Reader
163  {
164  public:
166  class Entry;
167 
168  private:
169  typedef std::list<Entry> StorageT;
170 
171  public:
172  typedef StorageT::value_type value_type;
174  typedef StorageT::iterator iterator;
175  typedef StorageT::const_iterator const_iterator;
176 
177  public:
179  Reader();
180 
184  Reader( std::istream & input_r );
185 
186  public:
192  const std::string & name() const;
193 
195  const Edition & edition() const;
196 
198  const std::string & description() const;
199 
201  const Date & ctime() const;
202 
203  public:
207  bool empty() const;
208 
210  size_type size() const;
211 
213  const_iterator begin() const;
214 
216  const_iterator end() const;
218 
219  private:
220  class Impl;
222  };
223 
225  std::ostream & operator<<( std::ostream & str, const Reader & obj );
226 
228 
230  //
231  // CLASS NAME : Reader::Entry
232  //
235  {
236  public:
237  Entry();
238  const std::string & kind() const;
239  const std::string & name() const;
240  const Edition & edition() const;
241  const Arch & arch() const;
242  public:
243  class Impl;
244  Entry( const shared_ptr<Impl> & pimpl_r );
245  private:
247  };
249 
251  } // namespace syscontent
254 } // namespace zypp
256 #endif // ZYPP_SYSCONTENT_H