libzypp 17.37.17
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
35namespace zypp
36{
38 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;
69 using size_type = StorageT::size_type;
70 using iterator = StorageT::iterator;
71 using const_iterator = StorageT::const_iterator;
72
73 public:
75 Writer();
76
77 public:
82
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:
119
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:
135
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 };
158
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;
182 using size_type = StorageT::size_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:
200
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:
215
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 //
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 };
257
258
260 } // namespace syscontent
263} // namespace zypp
265#endif // ZYPP_SYSCONTENT_H
Architecture.
Definition Arch.h:37
Store and operate on date (time_t).
Definition Date.h:33
Edition represents [epoch:]version[-release]
Definition Edition.h:61
Combining sat::Solvable and ResStatus.
Definition PoolItem.h:51
TraitsType::constPtrType constPtr
Definition ResObject.h:43
Restored ResObject data.
Definition SysContent.h:244
const Arch & arch() const
const std::string & name() const
const Edition & edition() const
const std::string & kind() const
const Date & ctime() const
Get creation date.
const_iterator end() const
Iterator to the end of collected data.
StorageT::const_iterator const_iterator
Definition SysContent.h:184
const Edition & edition() const
Get edition.
StorageT::size_type size_type
Definition SysContent.h:182
const std::string & description() const
Get description.
std::list< Entry > StorageT
Definition SysContent.h:178
StorageT::value_type value_type
Definition SysContent.h:181
RWCOW_pointer< Impl > _pimpl
Definition SysContent.h:230
StorageT::iterator iterator
Definition SysContent.h:183
bool empty() const
Whether no data collected so far.
const_iterator begin() const
Iterator to the begin of collected data.
const std::string & name() const
Get name.
size_type size() const
Number of items collected.
StorageT::size_type size_type
Definition SysContent.h:69
const Edition & edition() const
Get edition.
StorageT::value_type value_type
Definition SysContent.h:68
std::set< ResObject::constPtr > StorageT
Definition SysContent.h:66
std::ostream & writeXml(std::ostream &str) const
Write collected data as XML.
const std::string & description() const
Get description.
void addIf(const PoolItem &obj_r)
Collect PoolItem if it stays on the system.
StorageT::const_iterator const_iterator
Definition SysContent.h:71
RWCOW_pointer< Impl > _pimpl
Definition SysContent.h:156
std::ostream & operator<<(std::ostream &str, const Writer &obj)
Stream output.
Definition SysContent.h:161
void addInstalled(const PoolItem &obj_r)
Collect currently installed PoolItem.
const_iterator begin() const
Iterator to the begin of collected data.
bool empty() const
Whether no data collected so far.
size_type size() const
Number of items collected.
void add(const ResObject::constPtr &obj_r)
Unconditionally add this ResObject (or PoolItem).
const std::string & name() const
Get name.
StorageT::iterator iterator
Definition SysContent.h:70
const_iterator end() const
Iterator to the end of collected data.
xmlTextReader based interface to iterate xml streams.
Definition Reader.h:96
String related utilities and Regular expression matching.
std::ostream & operator<<(std::ostream &str, const ReadState &obj)
Definition libxmlfwd.cc:29
Easy-to use interface to the ZYPP dependency resolver.
const Arch Arch_armv7hnl Arch_armv7nhl ZYPP_API
Definition Arch.h:247
RW_pointer supporting 'copy on write' functionality.
Definition PtrTypes.h:469
Wrapper for const correct access via Smart pointer types.
Definition PtrTypes.h:293