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 urls_size_type baseUrlsSize() const; 00108 urls_const_iterator baseUrlsBegin() const; 00112 urls_const_iterator baseUrlsEnd() const; 00116 Url url() const 00117 { return( baseUrlsEmpty() ? Url() : *baseUrlsBegin()); } 00127 std::set<Url> baseUrls() const; 00136 void addBaseUrl( const Url &url ); 00141 void setBaseUrl( const Url &url ); 00142 00163 Pathname path() const; 00168 void setPath( const Pathname &path ); 00169 00174 Url mirrorListUrl() const; 00179 void setMirrorListUrl( const Url &url ); 00180 00185 repo::RepoType type() const; 00192 void setProbedType( const repo::RepoType &t ) const; 00197 void setType( const repo::RepoType &t ); 00198 00205 Pathname metadataPath() const; 00214 void setMetadataPath( const Pathname &path ); 00215 00219 Pathname packagesPath() const; 00225 void setPackagesPath( const Pathname &path ); 00226 00234 bool gpgCheck() const; 00244 void setGpgCheck( bool check ); 00245 00255 Url gpgKeyUrl() const; 00265 void setGpgKeyUrl( const Url &gpgkey ); 00266 00270 bool keepPackages() const; 00280 void setKeepPackages( bool keep ); 00281 00286 std::string service() const; 00290 void setService( const std::string& name ); 00291 00295 std::string targetDistribution() const; 00301 void setTargetDistribution(const std::string & targetDistribution); 00302 00303 public: 00308 bool hasLicense() const; 00309 00311 std::string getLicense( const Locale & lang_r = Locale() ); 00312 00317 LocaleSet getLicenseLocales() const; 00319 00325 00326 00327 public: 00332 virtual std::ostream & dumpOn( std::ostream & str ) const; 00333 00337 virtual std::ostream & dumpAsIniOn( std::ostream & str ) const; 00338 00342 virtual std::ostream & dumpAsXMLOn(std::ostream & str) const; 00343 00351 virtual std::ostream & dumpAsXMLOn( std::ostream & str, const std::string & content ) const; 00352 00353 class Impl; 00354 private: 00356 RWCOW_pointer<Impl> _pimpl; 00357 }; 00359 00361 typedef shared_ptr<RepoInfo> RepoInfo_Ptr; 00363 typedef shared_ptr<const RepoInfo> RepoInfo_constPtr; 00365 typedef std::list<RepoInfo> RepoInfoList; 00366 00368 std::ostream & operator<<( std::ostream & str, const RepoInfo & obj ); 00369 00370 00372 } // namespace zypp 00374 #endif // ZYPP2_REPOSITORYINFO_H