libzypp  11.13.5
ServiceInfo.h
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | ____ _ __ __ ___ |
3 | |__ / \ / / . \ . \ |
4 | / / \ V /| _/ _/ |
5 | / /__ | | | | | | |
6 | /_____||_| |_| |_| |
7 | |
8 \---------------------------------------------------------------------*/
12 #ifndef ZYPP_SERVICE_H
13 #define ZYPP_SERVICE_H
14 
15 #include <set>
16 #include <string>
17 
18 #include "zypp/Url.h"
19 
20 #include "zypp/repo/ServiceType.h"
21 #include "zypp/repo/RepoInfoBase.h"
22 
23 
25 namespace zypp
26 {
27 
29  //
30  // CLASS NAME : ServiceInfo
31  //
34  {
35  public:
37  ServiceInfo();
38 
44  ServiceInfo( const std::string & alias );
45 
52  ServiceInfo( const std::string & alias, const Url& url );
53 
54  virtual ~ServiceInfo();
55 
56  public:
58  static const ServiceInfo noService;
59 
60  public:
61 
67  Url url() const;
68 
74  void setUrl( const Url& url );
75 
79  repo::ServiceType type() const;
80 
86  void setType( const repo::ServiceType & type );
87 
88  void setProbedType( const repo::ServiceType & t ) const;
89 
90 
99  typedef std::set<std::string> ReposToEnable;
100  bool reposToEnableEmpty() const;
102  ReposToEnable::const_iterator reposToEnableBegin() const;
103  ReposToEnable::const_iterator reposToEnableEnd() const;
104 
106  bool repoToEnableFind( const std::string & alias_r ) const;
107 
109  void addRepoToEnable( const std::string & alias_r );
111  void delRepoToEnable( const std::string & alias_r );
113  void clearReposToEnable();
115 
123  typedef std::set<std::string> ReposToDisable;
124  bool reposToDisableEmpty() const;
126  ReposToDisable::const_iterator reposToDisableBegin() const;
127  ReposToDisable::const_iterator reposToDisableEnd() const;
128 
130  bool repoToDisableFind( const std::string & alias_r ) const;
131 
133  void addRepoToDisable( const std::string & alias_r );
135  void delRepoToDisable( const std::string & alias_r );
137  void clearReposToDisable();
139 
140  public:
146  virtual std::ostream & dumpAsIniOn( std::ostream & str ) const;
147 
151  virtual std::ostream & dumpAsXMLOn(std::ostream & str) const;
152 
160  virtual std::ostream & dumpAsXMLOn(
161  std::ostream & str, const std::string & content) const;
162 
163  class Impl;
164 
165  private:
167  };
169 
171  typedef shared_ptr<ServiceInfo> ServiceInfo_Ptr;
173  typedef shared_ptr<const ServiceInfo> ServiceInfo_constPtr;
175  typedef std::list<ServiceInfo> ServiceInfoList;
176 
178  std::ostream & operator<<( std::ostream & str, const ServiceInfo & obj );
179 
180 
182 } // namespace zypp
184 #endif // ZYPP_SAT_REPOSITORY_H