libzypp 8.13.6
|
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; 00140 void addBaseUrl( const Url &url ); 00145 void setBaseUrl( const Url &url ); 00146 00167 Pathname path() const; 00172 void setPath( const Pathname &path ); 00173 00178 Url mirrorListUrl() const; 00183 void setMirrorListUrl( const Url &url ); 00184 00189 repo::RepoType type() const; 00196 void setProbedType( const repo::RepoType &t ) const; 00201 void setType( const repo::RepoType &t ); 00202 00209 Pathname metadataPath() const; 00218 void setMetadataPath( const Pathname &path ); 00219 00223 Pathname packagesPath() const; 00229 void setPackagesPath( const Pathname &path ); 00230 00238 bool gpgCheck() const; 00248 void setGpgCheck( bool check ); 00249 00259 Url gpgKeyUrl() const; 00269 void setGpgKeyUrl( const Url &gpgkey ); 00270 00274 bool keepPackages() const; 00284 void setKeepPackages( bool keep ); 00285 00290 std::string service() const; 00294 void setService( const std::string& name ); 00295 00299 std::string targetDistribution() const; 00305 void setTargetDistribution(const std::string & targetDistribution); 00306 00307 public: 00312 bool hasLicense() const; 00313 00315 std::string getLicense( const Locale & lang_r = Locale() ); 00316 00321 LocaleSet getLicenseLocales() const; 00323 00329 00330 00331 public: 00336 virtual std::ostream & dumpOn( std::ostream & str ) const; 00337 00341 virtual std::ostream & dumpAsIniOn( std::ostream & str ) const; 00342 00346 virtual std::ostream & dumpAsXMLOn(std::ostream & str) const; 00347 00355 virtual std::ostream & dumpAsXMLOn( std::ostream & str, const std::string & content ) const; 00356 00357 class Impl; 00358 private: 00360 RWCOW_pointer<Impl> _pimpl; 00361 }; 00363 00365 typedef shared_ptr<RepoInfo> RepoInfo_Ptr; 00367 typedef shared_ptr<const RepoInfo> RepoInfo_constPtr; 00369 typedef std::list<RepoInfo> RepoInfoList; 00370 00372 std::ostream & operator<<( std::ostream & str, const RepoInfo & obj ); 00373 00374 00376 } // namespace zypp 00378 #endif // ZYPP2_REPOSITORYINFO_H