libzypp  17.16.0
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  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
std::ostream & operator<<(std::ostream &str, const Reader &obj)
Definition: SysContent.cc:444
RWCOW_pointer< Impl > _pimpl
Definition: SysContent.h:146
std::ostream & operator<<(std::ostream &str, const Writer &obj)
Definition: SysContent.h:152
std::set< ResObject::constPtr > StorageT
Definition: SysContent.h:57
const std::string & name() const
Definition: SysContent.cc:222
StorageT::iterator iterator
Definition: SysContent.h:61
Reader(const InputStream &stream_r, const Validate &validate_r=Validate::none())
Ctor.
Definition: Reader.cc:106
StorageT::size_type size_type
Definition: SysContent.h:173
const_iterator end() const
Iterator to the end of collected data.
Definition: SysContent.cc:436
Architecture.
Definition: Arch.h:36
Helper filtering the files offered by a RepomdFileReader.
const std::string & description() const
Get description.
Definition: SysContent.cc:421
void addIf(const PoolItem &obj_r)
Collect PoolItem if it stays on the system.
Definition: SysContent.cc:164
const Edition & edition() const
Get edition.
Definition: SysContent.cc:418
StorageT::size_type size_type
Definition: SysContent.h:60
String related utilities and Regular expression matching.
Edition represents [epoch:]version[-release]
Definition: Edition.h:60
TraitsType::constPtrType constPtr
Definition: ResObject.h:43
StorageT::value_type value_type
Definition: SysContent.h:172
const std::string & kind() const
Definition: SysContent.cc:219
RWCOW_pointer< Impl > _pimpl
Definition: SysContent.h:220
Writer()
Default Ctor.
Definition: SysContent.cc:134
const std::string & description() const
Get description.
Definition: SysContent.cc:150
const std::string & name() const
Get name.
Definition: SysContent.cc:138
const Edition & edition() const
Definition: SysContent.cc:225
bool empty() const
Whether no data collected so far.
Definition: SysContent.cc:427
Store and operate on date (time_t).
Definition: Date.h:32
bool empty() const
Whether no data collected so far.
Definition: SysContent.cc:176
const_iterator end() const
Iterator to the end of collected data.
Definition: SysContent.cc:185
const Edition & edition() const
Get edition.
Definition: SysContent.cc:144
const std::string & name() const
Get name.
Definition: SysContent.cc:415
std::ostream & writeXml(std::ostream &str) const
Write collected data as XML.
Definition: SysContent.cc:188
StorageT::const_iterator const_iterator
Definition: SysContent.h:175
StorageT::value_type value_type
Definition: SysContent.h:59
StorageT::const_iterator const_iterator
Definition: SysContent.h:62
SolvableIdType size_type
Definition: PoolMember.h:126
size_type size() const
Number of items collected.
Definition: SysContent.cc:430
void addInstalled(const PoolItem &obj_r)
Collect currently installed PoolItem.
Definition: SysContent.cc:156
RW_pointer< Impl > _pimpl
Definition: SysContent.h:246
StorageT::iterator iterator
Definition: SysContent.h:174
const_iterator begin() const
Iterator to the begin of collected data.
Definition: SysContent.cc:433
Combining sat::Solvable and ResStatus.
Definition: PoolItem.h:50
std::list< Entry > StorageT
Definition: SysContent.h:166
size_type size() const
Number of items collected.
Definition: SysContent.cc:179
const Arch & arch() const
Definition: SysContent.cc:228
Restored ResObject data.
Definition: SysContent.h:234
void add(const ResObject::constPtr &obj_r)
Unconditionally add this ResObject (or PoolItem).
Definition: SysContent.cc:173
Easy-to use interface to the ZYPP dependency resolver.
Definition: CodePitfalls.doc:1
const_iterator begin() const
Iterator to the begin of collected data.
Definition: SysContent.cc:182
const Date & ctime() const
Get creation date.
Definition: SysContent.cc:424
xmlTextReader based interface to iterate xml streams.
Definition: Reader.h:95
Collect and serialize a set of ResObject.
Definition: SysContent.h:55