libzypp: zypp/SysContent.h Source File

libzypp 17.38.11

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-core/base/PtrTypes.h>
20
21#include <zypp/PoolItem.h>
22#include <zypp/Edition.h>
23#include <zypp-core/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 ZYPP_API Writer
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;
156 RWCOW_pointer<Impl> _pimpl;
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 //
171 class ZYPP_API Reader
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;
230 RWCOW_pointer<Impl> _pimpl;
231 };
232
234 std::ostream & operator<<( std::ostream & str, const Reader & obj );
235
237
239 //
240 // CLASS NAME : Reader::Entry
241 //
243 class ZYPP_API Reader::Entry
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:
255 RW_pointer<Impl> _pimpl;
256 };
257
258
260 } // namespace syscontent
263} // namespace zypp
265#endif // ZYPP_SYSCONTENT_H
Date.h
Edition.h
PoolItem.h
PtrTypes.h
Impl
shared_ptr
zypp::Arch
Architecture.
Definition Arch.h:37
zypp::Date
Store and operate on date (time_t).
Definition Date.h:33
zypp::Edition
Edition represents [epoch:]version[-release].
Definition Edition.h:60
zypp::PoolItem
Combining sat::Solvable and ResStatus.
Definition PoolItem.h:51
zypp::ResObject::constPtr
TraitsType::constPtrType constPtr
Definition ResObject.h:43
zypp::syscontent::Reader::Entry
Restored ResObject data.
Definition SysContent.h:244
zypp::syscontent::Reader::Entry::arch
const Arch & arch() const
Definition SysContent.cc:228
zypp::syscontent::Reader::Entry::name
const std::string & name() const
Definition SysContent.cc:222
zypp::syscontent::Reader::Entry::Entry
Entry()
Definition SysContent.cc:211
zypp::syscontent::Reader::Entry::_pimpl
RW_pointer< Impl > _pimpl
Definition SysContent.h:255
zypp::syscontent::Reader::Entry::edition
const Edition & edition() const
Definition SysContent.cc:225
zypp::syscontent::Reader::Entry::kind
const std::string & kind() const
Definition SysContent.cc:219
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::Reader::const_iterator
StorageT::const_iterator const_iterator
Definition SysContent.h:184
zypp::syscontent::Reader::edition
const Edition & edition() const
Get edition.
Definition SysContent.cc:418
zypp::syscontent::Reader::size_type
StorageT::size_type size_type
Definition SysContent.h:182
zypp::syscontent::Reader::Reader
Reader()
Default Ctor.
Definition SysContent.cc:407
zypp::syscontent::Reader::description
const std::string & description() const
Get description.
Definition SysContent.cc:421
zypp::syscontent::Reader::StorageT
std::list< Entry > StorageT
Definition SysContent.h:178
zypp::syscontent::Reader::value_type
StorageT::value_type value_type
Definition SysContent.h:181
zypp::syscontent::Reader::_pimpl
RWCOW_pointer< Impl > _pimpl
Definition SysContent.h:230
zypp::syscontent::Reader::iterator
StorageT::iterator iterator
Definition SysContent.h:183
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::name
const std::string & name() const
Get name.
Definition SysContent.cc:415
zypp::syscontent::Reader::size
size_type size() const
Number of items collected.
Definition SysContent.cc:430
zypp::syscontent::Writer::Impl
Definition SysContent.cc:62
zypp::syscontent::Writer
Collect and serialize a set of ResObject.
Definition SysContent.h:65
zypp::syscontent::Writer::size_type
StorageT::size_type size_type
Definition SysContent.h:69
zypp::syscontent::Writer::edition
const Edition & edition() const
Get edition.
Definition SysContent.cc:144
zypp::syscontent::Writer::value_type
StorageT::value_type value_type
Definition SysContent.h:68
zypp::syscontent::Writer::StorageT
std::set< ResObject::constPtr > StorageT
Definition SysContent.h:66
zypp::syscontent::Writer::writeXml
std::ostream & writeXml(std::ostream &str) const
Write collected data as XML.
Definition SysContent.cc:188
zypp::syscontent::Writer::description
const std::string & description() const
Get description.
Definition SysContent.cc:150
zypp::syscontent::Writer::addIf
void addIf(const PoolItem &obj_r)
Collect PoolItem if it stays on the system.
Definition SysContent.cc:164
zypp::syscontent::Writer::const_iterator
StorageT::const_iterator const_iterator
Definition SysContent.h:71
zypp::syscontent::Writer::_pimpl
RWCOW_pointer< Impl > _pimpl
Definition SysContent.h:156
zypp::syscontent::Writer::Writer
Writer()
Default Ctor.
Definition SysContent.cc:134
zypp::syscontent::Writer::addInstalled
void addInstalled(const PoolItem &obj_r)
Collect currently installed PoolItem.
Definition SysContent.cc:156
zypp::syscontent::Writer::begin
const_iterator begin() const
Iterator to the begin of collected data.
Definition SysContent.cc:182
zypp::syscontent::Writer::empty
bool empty() const
Whether no data collected so far.
Definition SysContent.cc:176
zypp::syscontent::Writer::size
size_type size() const
Number of items collected.
Definition SysContent.cc:179
zypp::syscontent::Writer::add
void add(const ResObject::constPtr &obj_r)
Unconditionally add this ResObject (or PoolItem).
Definition SysContent.cc:173
zypp::syscontent::Writer::name
const std::string & name() const
Get name.
Definition SysContent.cc:138
zypp::syscontent::Writer::iterator
StorageT::iterator iterator
Definition SysContent.h:70
zypp::syscontent::Writer::end
const_iterator end() const
Iterator to the end of collected data.
Definition SysContent.cc:185
zypp::xml::Reader
xmlTextReader based interface to iterate xml streams.
Definition Reader.h:96
str
String related utilities and Regular expression matching.
zypp::syscontent
Definition SysContent.cc:27
zypp::xml::operator<<
std::ostream & operator<<(std::ostream &str, const ReadState &obj)
relates: ReadState Stream output.
Definition libxmlfwd.cc:29
zypp
Easy-to use interface to the ZYPP dependency resolver.
Definition CodePitfalls.doc:2
zypp::ZYPP_API
const Arch Arch_empty ZYPP_API
relates: Arch This is an empty Arch represented by an empty string.
Definition Arch.h:173
zypp::RWCOW_pointer
RW_pointer supporting 'copy on write' functionality.
Definition PtrTypes.h:469
zypp::RW_pointer
Wrapper for const correct access via Smart pointer types.
Definition PtrTypes.h:293