libzypp  11.13.5
RepoInfoBase.h
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | ____ _ __ __ ___ |
3 | |__ / \ / / . \ . \ |
4 | / / \ V /| _/ _/ |
5 | / /__ | | | | | | |
6 | /_____||_| |_| |_| |
7 | |
8 \---------------------------------------------------------------------*/
12 #ifndef REPOINFOBASE_H_
13 #define REPOINFOBASE_H_
14 
15 #include <iosfwd>
16 
17 #include "zypp/base/PtrTypes.h"
18 
19 #include "zypp/Pathname.h"
20 
22 namespace zypp
23 {
24 
25  namespace repo
26  {
27 
29  //
30  // CLASS NAME : RepoInfoBase
31  //
37  {
38  friend std::ostream & operator<<( std::ostream & str, const RepoInfoBase & obj );
39 
40  public:
41  RepoInfoBase();
42  RepoInfoBase(const std::string & alias);
43  virtual ~RepoInfoBase();
44 
52  std::string alias() const;
53 
57  std::string escaped_alias() const;
58 
65  std::string name() const;
66 
72  std::string label() const;
73 
78  bool enabled() const;
79 
84  bool autorefresh() const;
85 
92  Pathname filepath() const;
93 
94 
95  public:
96 
101  void setAlias( const std::string &alias );
102 
107  void setName( const std::string &name );
108 
113  void setEnabled( bool enabled );
114 
119  void setAutorefresh( bool autorefresh );
120 
129  void setFilepath( const Pathname &filename );
130 
135  virtual std::ostream & dumpOn( std::ostream & str ) const;
136 
141  virtual std::ostream & dumpAsIniOn( std::ostream & str ) const;
142 
147  virtual std::ostream & dumpAsXMLOn(std::ostream & str) const;
148 
152  virtual std::ostream & dumpAsXMLOn(
153  std::ostream & str, const std::string & content) const;
154 
155  class Impl;
156  private:
159  };
161 
163  inline bool operator==( const RepoInfoBase & lhs, const RepoInfoBase & rhs )
164  { return lhs.alias() == rhs.alias(); }
165 
167  inline bool operator!=( const RepoInfoBase & lhs, const RepoInfoBase & rhs )
168  { return lhs.alias() != rhs.alias(); }
169 
170  inline bool operator<( const RepoInfoBase & lhs, const RepoInfoBase & rhs )
171  { return lhs.alias() < rhs.alias(); }
172 
174  std::ostream & operator<<( std::ostream & str, const RepoInfoBase & obj );
175 
177  typedef shared_ptr<RepoInfoBase> RepoInfoBase_Ptr;
179  typedef shared_ptr<const RepoInfoBase> RepoInfoBase_constPtr;
180 
181 
183  } // namespace repo
186 } // namespace zypp
188 
189 #endif /*REPOINFOBASE_H_*/