SuseTagsImpl.h

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------\
00002 |                          ____ _   __ __ ___                          |
00003 |                         |__  / \ / / . \ . \                         |
00004 |                           / / \ V /|  _/  _/                         |
00005 |                          / /__ | | | | | |                           |
00006 |                         /_____||_| |_| |_|                           |
00007 |                                                                      |
00008 \---------------------------------------------------------------------*/
00012 #ifndef ZYPP_SOURCE_SUSETAGS_SUSETAGSIMPL_H
00013 #define ZYPP_SOURCE_SUSETAGS_SUSETAGSIMPL_H
00014 
00015 #include <iosfwd>
00016 #include <string>
00017 
00018 #include "zypp/Pathname.h"
00019 #include "zypp/source/SourceImpl.h"
00020 #include "zypp/Product.h"
00021 #include "zypp/CheckSum.h"
00022 #include "zypp/source/susetags/SuseTagsProductImpl.h"
00023 #include "zypp/source/susetags/SuseTagsPackageImpl.h"
00024 
00026 namespace zypp
00027 { 
00028 
00029   namespace source
00030   { 
00031 
00032     namespace susetags
00033     { 
00034 
00035       struct SuseTagsPackageImplData
00036       {
00037         SuseTagsPackageImplData()
00038         {
00039         }
00040         
00041         TranslatedText _summary;
00042         TranslatedText _description;
00043         TranslatedText _insnotify;
00044         TranslatedText _delnotify;
00045         License _license_to_confirm;
00046         std::list<std::string> _authors;
00047       };
00048       
00050       //
00051       //        CLASS NAME : SuseTagsImpl
00052       //
00054       class SuseTagsImpl : public SourceImpl
00055       {
00056       public:
00057         typedef intrusive_ptr<SuseTagsImpl>       Ptr;
00058         typedef intrusive_ptr<const SuseTagsImpl> constPtr;
00059 
00060       public:
00065         SuseTagsImpl();
00067         ~SuseTagsImpl();
00068 
00069       public:
00070         virtual void createResolvables(Source_Ref source_r);
00071 
00073         virtual ResStore provideResolvables(Source_Ref source_r, zypp::Resolvable::Kind kind);
00074         
00075         virtual std::string type(void) const
00076         { return typeString(); }
00077 
00082         static std::string typeString(void)
00083         { return "YaST"; }
00084         
00085         virtual unsigned numberOfMedia(void) const;
00086         virtual std::string vendor (void) const;
00087         virtual const std::list<Pathname> publicKeys();
00088         virtual std::string unique_id (void) const;
00089         
00090         Pathname sourceDir( const std::string & dir );
00091         virtual void storeMetadata(const Pathname & cache_dir_r);
00092         
00096         virtual media::MediaVerifierRef verifier(media::MediaNr media_nr);
00097 
00098       protected:
00100         virtual std::ostream & dumpOn( std::ostream & str ) const;
00101         void initCacheDir(const Pathname & cache_dir_r);
00102         bool cacheExists();
00103       private:
00108         virtual void factoryInit();
00109         
00110         void readContentFile();
00111         
00112         void provideProducts(Source_Ref source_r, ResStore& store);
00113         void providePackages(Source_Ref source_r, ResStore& store);
00114         void provideSelections(Source_Ref source_r, ResStore& store);
00115         void provideSelection(Source_Ref source_r, ResStore& store);
00116         void providePatterns(Source_Ref source_r, ResStore& store);
00117         
00121         bool verifyChecksumsMode();
00122         
00127         void verifyFile( const Pathname &path, const std::string &key);
00128         
00129         unsigned _media_count;
00130         
00131         // descr dir we are using
00132         // depends if we are on media or
00133         // cache
00134         Pathname _descr_dir;
00135         Pathname _data_dir;
00136         
00137         // descr dir on media.
00138         // we need it if we refresh
00139         // already running from cache
00140         Pathname _orig_descr_dir;
00141         
00142         Pathname _content_file;
00143         Pathname _content_file_sig;
00144         Pathname _content_file_key;
00145         
00146         std::string _vendor;
00147         std::string _media_id;
00152         detail::ResImplTraits<SuseTagsProductImpl>::Ptr _prodImpl;
00153         Product::Ptr _product;       
00154         public:
00155         
00156         // shared data between packages with same NVRA
00157         std::map<NVRA, SuseTagsPackageImplData> _package_data;
00158         // list of packages which depend on another package for its data
00159         std::map<NVRA, bool> _is_shared;
00160         
00161         // list of translation files
00162         std::list<std::string> _pkg_translations;
00163       };
00165 
00167     } // namespace susetags
00169 
00170     using susetags::SuseTagsImpl;
00171 
00173   } // namespace source
00176 } // namespace zypp
00178 #endif // ZYPP_SOURCE_SUSETAGS_SUSETAGSIMPL_H

Generated on Thu May 4 16:03:26 2006 for zypp by  doxygen 1.4.6