libzypp 9.41.1

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 );
00147       void setBaseUrls( url_set urls );
00148 
00169       Pathname path() const;
00174       void setPath( const Pathname &path );
00175 
00180       Url mirrorListUrl() const;
00185       void setMirrorListUrl( const Url &url );
00186 
00191       repo::RepoType type() const;
00198       void setProbedType( const repo::RepoType &t ) const;
00203       void setType( const repo::RepoType &t );
00204 
00211       Pathname metadataPath() const;
00220       void setMetadataPath( const Pathname &path );
00221 
00225       Pathname packagesPath() const;
00231       void setPackagesPath( const Pathname &path );
00232 
00240       bool gpgCheck() const;
00250       void setGpgCheck( bool check );
00251 
00261       Url gpgKeyUrl() const;
00271       void setGpgKeyUrl( const Url &gpgkey );
00272 
00276       bool keepPackages() const;
00286       void setKeepPackages( bool keep );
00287 
00292       std::string service() const;
00296       void setService( const std::string& name );
00297 
00301       std::string targetDistribution() const;
00307       void setTargetDistribution(const std::string & targetDistribution);
00308 
00309     public:
00314       bool hasLicense() const;
00315 
00317       std::string getLicense( const Locale & lang_r = Locale() );
00318 
00323       LocaleSet getLicenseLocales() const;
00325 
00331 
00332 
00333     public:
00338       virtual std::ostream & dumpOn( std::ostream & str ) const;
00339 
00343       virtual std::ostream & dumpAsIniOn( std::ostream & str ) const;
00344 
00348       virtual std::ostream & dumpAsXMLOn(std::ostream & str) const;
00349 
00357       virtual std::ostream & dumpAsXMLOn( std::ostream & str, const std::string & content ) const;
00358 
00359       class Impl;
00360     private:
00362       RWCOW_pointer<Impl> _pimpl;
00363   };
00365 
00367   typedef shared_ptr<RepoInfo> RepoInfo_Ptr;
00369   typedef shared_ptr<const RepoInfo> RepoInfo_constPtr;
00371   typedef std::list<RepoInfo> RepoInfoList;
00372 
00374   std::ostream & operator<<( std::ostream & str, const RepoInfo & obj );
00375 
00376 
00378 } // namespace zypp
00380 #endif // ZYPP2_REPOSITORYINFO_H