libzypp  10.5.0
RepoInfo.h
Go to the documentation of this file.
00001 /*---------------------------------------------------------------------\
00002 |                          ____ _   __ __ ___                          |
00003 |                         |__  / \ / / . \ . \                         |
00004 |                           / / \ V /|  _/  _/                         |
00005 |                          / /__ | | | | | |                           |
00006 |                         /_____||_| |_| |_|                           |
00007 |                                                                      |
00008 \---------------------------------------------------------------------*/
00012 #ifndef ZYPP2_REPOSITORYINFO_H
00013 #define ZYPP2_REPOSITORYINFO_H
00014 
00015 #include <list>
00016 #include <set>
00017 
00018 #include "zypp/base/Iterator.h"
00019 #include "zypp/base/Deprecated.h"
00020 
00021 #include "zypp/Url.h"
00022 #include "zypp/Locale.h"
00023 #include "zypp/repo/RepoType.h"
00024 #include "zypp/repo/RepoVariables.h"
00025 
00026 #include "zypp/repo/RepoInfoBase.h"
00027 
00029 namespace zypp
00030 { 
00031 
00033   //
00034   //    CLASS NAME : RepoInfo
00035   //
00066   class RepoInfo : public repo::RepoInfoBase
00067   {
00068     friend std::ostream & operator<<( std::ostream & str, const RepoInfo & obj );
00069 
00070     public:
00071       RepoInfo();
00072       virtual ~RepoInfo();
00073 
00075       static const RepoInfo noRepo;
00076 
00077     public:
00081       static unsigned defaultPriority();
00086       unsigned priority() const;
00092       void setPriority( unsigned newval_r );
00093 
00094       typedef std::set<Url>           url_set;
00095       typedef url_set::size_type      urls_size_type;
00096       typedef transform_iterator<repo::RepoVariablesUrlReplacer, url_set::const_iterator> urls_const_iterator;
00100       bool baseUrlsEmpty() const;
00104       bool baseUrlSet() const;
00108       urls_size_type baseUrlsSize() const;
00112       urls_const_iterator baseUrlsBegin() const;
00116       urls_const_iterator baseUrlsEnd() const;
00120       Url url() const
00121       { return( baseUrlsEmpty() ? Url() : *baseUrlsBegin()); }
00131       std::set<Url> baseUrls() const;
00139       void addBaseUrl( const Url &url );
00143       void setBaseUrl( const Url &url );
00144 
00165       Pathname path() const;
00170       void setPath( const Pathname &path );
00171 
00176       Url mirrorListUrl() const;
00181       void setMirrorListUrl( const Url &url );
00182 
00187       repo::RepoType type() const;
00194       void setProbedType( const repo::RepoType &t ) const;
00199       void setType( const repo::RepoType &t );
00200 
00207       Pathname metadataPath() const;
00216       void setMetadataPath( const Pathname &path );
00217 
00221       Pathname packagesPath() const;
00227       void setPackagesPath( const Pathname &path );
00228 
00236       bool gpgCheck() const;
00246       void setGpgCheck( bool check );
00247 
00257       Url gpgKeyUrl() const;
00267       void setGpgKeyUrl( const Url &gpgkey );
00268 
00272       bool keepPackages() const;
00282       void setKeepPackages( bool keep );
00283 
00288       std::string service() const;
00292       void setService( const std::string& name );
00293 
00297       std::string targetDistribution() const;
00303       void setTargetDistribution(const std::string & targetDistribution);
00304 
00305     public:
00310       bool hasLicense() const;
00311 
00313       std::string getLicense( const Locale & lang_r = Locale() );
00314 
00319       LocaleSet getLicenseLocales() const;
00321 
00327 
00328 
00329     public:
00334       virtual std::ostream & dumpOn( std::ostream & str ) const;
00335 
00339       virtual std::ostream & dumpAsIniOn( std::ostream & str ) const;
00340 
00344       virtual std::ostream & dumpAsXMLOn(std::ostream & str) const;
00345 
00353       virtual std::ostream & dumpAsXMLOn( std::ostream & str, const std::string & content ) const;
00354 
00355       class Impl;
00356     private:
00358       RWCOW_pointer<Impl> _pimpl;
00359   };
00361 
00363   typedef shared_ptr<RepoInfo> RepoInfo_Ptr;
00365   typedef shared_ptr<const RepoInfo> RepoInfo_constPtr;
00367   typedef std::list<RepoInfo> RepoInfoList;
00368 
00370   std::ostream & operator<<( std::ostream & str, const RepoInfo & obj );
00371 
00372 
00374 } // namespace zypp
00376 #endif // ZYPP2_REPOSITORYINFO_H