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