libzypp 17.31.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
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 //
64 class Writer
65 {
66 typedef std::set<ResObject::constPtr> StorageT;
67 public:
68 typedef StorageT::value_type value_type;
70 typedef StorageT::iterator iterator;
71 typedef StorageT::const_iterator 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 //
171 class Reader
172 {
173 public:
175 class Entry;
176
177 private:
178 typedef std::list<Entry> StorageT;
179
180 public:
181 typedef StorageT::value_type value_type;
183 typedef StorageT::iterator iterator;
184 typedef StorageT::const_iterator 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 //
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
RepoManager implementation.
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
Definition: SysContent.cc:228
const std::string & name() const
Definition: SysContent.cc:222
RW_pointer< Impl > _pimpl
Definition: SysContent.h:255
const Edition & edition() const
Definition: SysContent.cc:225
const std::string & kind() const
Definition: SysContent.cc:219
const Date & ctime() const
Get creation date.
Definition: SysContent.cc:424
const_iterator end() const
Iterator to the end of collected data.
Definition: SysContent.cc:436
const Edition & edition() const
Get edition.
Definition: SysContent.cc:418
const std::string & description() const
Get description.
Definition: SysContent.cc:421
StorageT::const_iterator const_iterator
Definition: SysContent.h:184
StorageT::size_type size_type
Definition: SysContent.h:182
RWCOW_pointer< Impl > _pimpl
Definition: SysContent.h:229
StorageT::iterator iterator
Definition: SysContent.h:183
StorageT::value_type value_type
Definition: SysContent.h:181
bool empty() const
Whether no data collected so far.
Definition: SysContent.cc:427
const_iterator begin() const
Iterator to the begin of collected data.
Definition: SysContent.cc:433
const std::string & name() const
Get name.
Definition: SysContent.cc:415
std::list< Entry > StorageT
Definition: SysContent.h:175
size_type size() const
Number of items collected.
Definition: SysContent.cc:430
Collect and serialize a set of ResObject.
Definition: SysContent.h:65
const Edition & edition() const
Get edition.
Definition: SysContent.cc:144
std::ostream & writeXml(std::ostream &str) const
Write collected data as XML.
Definition: SysContent.cc:188
std::set< ResObject::constPtr > StorageT
Definition: SysContent.h:66
const std::string & description() const
Get description.
Definition: SysContent.cc:150
StorageT::value_type value_type
Definition: SysContent.h:68
void addIf(const PoolItem &obj_r)
Collect PoolItem if it stays on the system.
Definition: SysContent.cc:164
StorageT::iterator iterator
Definition: SysContent.h:70
RWCOW_pointer< Impl > _pimpl
Definition: SysContent.h:155
std::ostream & operator<<(std::ostream &str, const Writer &obj)
Stream output.
Definition: SysContent.h:161
Writer()
Default Ctor.
Definition: SysContent.cc:134
void addInstalled(const PoolItem &obj_r)
Collect currently installed PoolItem.
Definition: SysContent.cc:156
const_iterator begin() const
Iterator to the begin of collected data.
Definition: SysContent.cc:182
StorageT::const_iterator const_iterator
Definition: SysContent.h:71
bool empty() const
Whether no data collected so far.
Definition: SysContent.cc:176
size_type size() const
Number of items collected.
Definition: SysContent.cc:179
void add(const ResObject::constPtr &obj_r)
Unconditionally add this ResObject (or PoolItem).
Definition: SysContent.cc:173
const std::string & name() const
Get name.
Definition: SysContent.cc:138
StorageT::size_type size_type
Definition: SysContent.h:69
const_iterator end() const
Iterator to the end of collected data.
Definition: SysContent.cc:185
xmlTextReader based interface to iterate xml streams.
Definition: Reader.h:96
Reader(const InputStream &stream_r, const Validate &validate_r=Validate::none())
Ctor.
Definition: Reader.cc:106
String related utilities and Regular expression matching.
SolvableIdType size_type
Definition: PoolMember.h:126
std::ostream & operator<<(std::ostream &str, const Reader &obj)
Definition: SysContent.cc:444
Easy-to use interface to the ZYPP dependency resolver.
Definition: CodePitfalls.doc:2
RW_pointer supporting 'copy on write' functionality.
Definition: PtrTypes.h:459
Wrapper for const correct access via Smart pointer types.
Definition: PtrTypes.h:286