libzypp  10.5.0
SysContent.h
Go to the documentation of this file.
00001 /*---------------------------------------------------------------------\
00002 |                          ____ _   __ __ ___                          |
00003 |                         |__  / \ / / . \ . \                         |
00004 |                           / / \ V /|  _/  _/                         |
00005 |                          / /__ | | | | | |                           |
00006 |                         /_____||_| |_| |_|                           |
00007 |                                                                      |
00008 \---------------------------------------------------------------------*/
00012 #ifndef ZYPP_SYSCONTENT_H
00013 #define ZYPP_SYSCONTENT_H
00014 
00015 #include <iosfwd>
00016 #include <string>
00017 #include <set>
00018 
00019 #include "zypp/base/PtrTypes.h"
00020 
00021 #include "zypp/PoolItem.h"
00022 #include "zypp/Edition.h"
00023 #include "zypp/Date.h"
00024 
00026 namespace zypp
00027 { 
00028 
00029   namespace syscontent
00030   { 
00031 
00033     //
00034     //  CLASS NAME : Writer
00035     //
00055     class Writer
00056     {
00057       typedef std::set<ResObject::constPtr> StorageT;
00058     public:
00059       typedef StorageT::value_type     value_type;
00060       typedef StorageT::size_type      size_type;
00061       typedef StorageT::iterator       iterator;
00062       typedef StorageT::const_iterator const_iterator;
00063 
00064     public:
00066       Writer();
00067 
00068     public:
00074       const std::string & name() const;
00075 
00077       Writer & name( const std::string & val_r );
00078 
00080       const Edition & edition() const;
00081 
00083       Writer & edition( const Edition & val_r );
00084 
00086       const std::string & description() const;
00087 
00089       Writer & description( const std::string & val_r );
00091 
00092     public:
00111       void addInstalled( const PoolItem & obj_r );
00112 
00117       void addIf( const PoolItem & obj_r );
00118 
00120       void add( const ResObject::constPtr & obj_r );
00122 
00123     public:
00127       bool empty() const;
00128 
00130       size_type size() const;
00131 
00133       const_iterator begin() const;
00134 
00136       const_iterator end() const;
00138 
00139     public:
00143       std::ostream & writeXml( std::ostream & str ) const;
00144 
00145     private:
00146       class Impl;
00147       RWCOW_pointer<Impl> _pimpl;
00148     };
00150 
00152     inline std::ostream & operator<<( std::ostream & str, const Writer & obj )
00153     { return obj.writeXml( str ); }
00154 
00156     //
00157     //  CLASS NAME : Reader
00158     //
00162     class Reader
00163     {
00164     public:
00166       class Entry;
00167 
00168     private:
00169       typedef std::list<Entry> StorageT;
00170 
00171     public:
00172       typedef StorageT::value_type     value_type;
00173       typedef StorageT::size_type      size_type;
00174       typedef StorageT::iterator       iterator;
00175       typedef StorageT::const_iterator const_iterator;
00176 
00177     public:
00179       Reader();
00180 
00184       Reader( std::istream & input_r );
00185 
00186     public:
00192       const std::string & name() const;
00193 
00195       const Edition & edition() const;
00196 
00198       const std::string & description() const;
00199 
00201       const Date & ctime() const;
00202 
00203     public:
00207       bool empty() const;
00208 
00210       size_type size() const;
00211 
00213       const_iterator begin() const;
00214 
00216       const_iterator end() const;
00218 
00219     private:
00220       class Impl;
00221       RWCOW_pointer<Impl> _pimpl;
00222     };
00223 
00225     std::ostream & operator<<( std::ostream & str, const Reader & obj );
00226 
00228 
00230     //
00231     //  CLASS NAME : Reader::Entry
00232     //
00234     class Reader::Entry
00235     {
00236     public:
00237       Entry();
00238       const std::string & kind() const;
00239       const std::string & name() const;
00240       const Edition & edition() const;
00241       const Arch & arch() const;
00242     public:
00243       class Impl;
00244       Entry( const shared_ptr<Impl> & pimpl_r );
00245     private:
00246       RW_pointer<Impl> _pimpl;
00247     };
00249 
00251   } // namespace syscontent
00254 } // namespace zypp
00256 #endif // ZYPP_SYSCONTENT_H