libzypp  11.13.5
RepoInfo.h
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | ____ _ __ __ ___ |
3 | |__ / \ / / . \ . \ |
4 | / / \ V /| _/ _/ |
5 | / /__ | | | | | | |
6 | /_____||_| |_| |_| |
7 | |
8 \---------------------------------------------------------------------*/
12 #ifndef ZYPP2_REPOSITORYINFO_H
13 #define ZYPP2_REPOSITORYINFO_H
14 
15 #include <list>
16 #include <set>
17 
18 #include "zypp/base/Iterator.h"
19 #include "zypp/APIConfig.h"
20 
21 #include "zypp/Url.h"
22 #include "zypp/Locale.h"
23 #include "zypp/repo/RepoType.h"
25 
26 #include "zypp/repo/RepoInfoBase.h"
27 
29 namespace zypp
30 {
31 
33  //
34  // CLASS NAME : RepoInfo
35  //
67  {
68  friend std::ostream & operator<<( std::ostream & str, const RepoInfo & obj );
69 
70  public:
71  RepoInfo();
72  virtual ~RepoInfo();
73 
75  static const RepoInfo noRepo;
76 
77  public:
81  static unsigned defaultPriority();
86  unsigned priority() const;
92  void setPriority( unsigned newval_r );
93 
94  typedef std::set<Url> url_set;
96  typedef transform_iterator<repo::RepoVariablesUrlReplacer, url_set::const_iterator> urls_const_iterator;
100  bool baseUrlsEmpty() const;
104  bool baseUrlSet() const;
120  Url url() const
121  { return( baseUrlsEmpty() ? Url() : *baseUrlsBegin()); }
131  std::set<Url> baseUrls() const;
139  void addBaseUrl( const Url &url );
143  void setBaseUrl( const Url &url );
144 
165  Pathname path() const;
170  void setPath( const Pathname &path );
171 
176  Url mirrorListUrl() const;
181  void setMirrorListUrl( const Url &url );
182 
187  repo::RepoType type() const;
194  void setProbedType( const repo::RepoType &t ) const;
199  void setType( const repo::RepoType &t );
200 
207  Pathname metadataPath() const;
216  void setMetadataPath( const Pathname &path );
217 
221  Pathname packagesPath() const;
227  void setPackagesPath( const Pathname &path );
228 
236  bool gpgCheck() const;
246  void setGpgCheck( bool check );
247 
257  Url gpgKeyUrl() const;
267  void setGpgKeyUrl( const Url &gpgkey );
268 
272  bool keepPackages() const;
282  void setKeepPackages( bool keep );
283 
288  std::string service() const;
292  void setService( const std::string& name );
293 
297  std::string targetDistribution() const;
303  void setTargetDistribution(const std::string & targetDistribution);
304 
305  public:
310  bool hasLicense() const;
311 
313  std::string getLicense( const Locale & lang_r = Locale() );
314 
321 
327 
328 
329  public:
334  virtual std::ostream & dumpOn( std::ostream & str ) const;
335 
339  virtual std::ostream & dumpAsIniOn( std::ostream & str ) const;
340 
344  virtual std::ostream & dumpAsXMLOn(std::ostream & str) const;
345 
353  virtual std::ostream & dumpAsXMLOn( std::ostream & str, const std::string & content ) const;
354 
355  class Impl;
356  private:
359  };
361 
363  typedef shared_ptr<RepoInfo> RepoInfo_Ptr;
365  typedef shared_ptr<const RepoInfo> RepoInfo_constPtr;
367  typedef std::list<RepoInfo> RepoInfoList;
368 
370  std::ostream & operator<<( std::ostream & str, const RepoInfo & obj );
371 
372 
374 } // namespace zypp
376 #endif // ZYPP2_REPOSITORYINFO_H