libzypp  13.10.6
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
std::string alias() const
unique identifier for this source.
std::set< std::string > ReposToEnable
Container of repos.
Definition: ServiceInfo.h:99
ReposToDisable::size_type reposToDisableSize() const
Definition: ServiceInfo.cc:143
virtual std::ostream & dumpAsXMLOn(std::ostream &str) const
Write an XML representation of this ServiceInfo object.
Definition: ServiceInfo.cc:181
ReposToEnable::const_iterator reposToEnableBegin() const
Definition: ServiceInfo.cc:118
void clearReposToEnable()
Clear the set of ReposToEnable.
Definition: ServiceInfo.cc:136
void addRepoToEnable(const std::string &alias_r)
Add alias_r to the set of ReposToEnable.
Definition: ServiceInfo.cc:127
ReposToDisable::const_iterator reposToDisableEnd() const
Definition: ServiceInfo.cc:149
void setType(const repo::ServiceType &type)
Set service type.
Definition: ServiceInfo.cc:106
RWCOW_pointer< Impl > _pimpl
Definition: ServiceInfo.h:163
ReposToDisable::const_iterator reposToDisableBegin() const
Definition: ServiceInfo.cc:146
shared_ptr< const ServiceInfo > ServiceInfo_constPtr
Definition: ServiceInfo.h:173
void clearReposToDisable()
Clear the set of ReposToDisable.
Definition: ServiceInfo.cc:164
std::ostream & operator<<(std::ostream &str, const Exception &obj)
Definition: Exception.cc:120
Service type enumeration.
Definition: ServiceType.h:26
bool reposToEnableEmpty() const
Definition: ServiceInfo.cc:112
ServiceInfo()
Default ctor creates noService.
Definition: ServiceInfo.cc:88
void delRepoToEnable(const std::string &alias_r)
Remove alias_r from the set of ReposToEnable.
Definition: ServiceInfo.cc:133
bool reposToDisableEmpty() const
Definition: ServiceInfo.cc:140
virtual ~ServiceInfo()
Definition: ServiceInfo.cc:98
SolvableIdType size_type
Definition: PoolMember.h:99
void setUrl(const Url &url)
Sets url for this service.
Definition: ServiceInfo.cc:102
std::set< std::string > ReposToDisable
Container of repos.
Definition: ServiceInfo.h:123
std::list< ServiceInfo > ServiceInfoList
Definition: ServiceInfo.h:175
static const ServiceInfo noService
Represents an empty service.
Definition: ServiceInfo.h:58
bool repoToDisableFind(const std::string &alias_r) const
Whether alias_r is mentioned in ReposToDisable.
Definition: ServiceInfo.cc:152
void delRepoToDisable(const std::string &alias_r)
Remove alias_r from the set of ReposToDisable.
Definition: ServiceInfo.cc:161
void addRepoToDisable(const std::string &alias_r)
Add alias_r to the set of ReposToDisable.
Definition: ServiceInfo.cc:155
Base class implementing common features of RepoInfo and ServiceInfo.
Definition: RepoInfoBase.h:36
bool repoToEnableFind(const std::string &alias_r) const
Whether alias_r is mentioned in ReposToEnable.
Definition: ServiceInfo.cc:124
ReposToEnable::const_iterator reposToEnableEnd() const
Definition: ServiceInfo.cc:121
ReposToEnable::size_type reposToEnableSize() const
Definition: ServiceInfo.cc:115
shared_ptr< ServiceInfo > ServiceInfo_Ptr
Definition: ServiceInfo.h:171
Url url() const
Gets url to service.
Definition: ServiceInfo.cc:101
void setProbedType(const repo::ServiceType &t) const
Definition: ServiceInfo.cc:109
Url manipulation class.
Definition: Url.h:87
virtual std::ostream & dumpAsIniOn(std::ostream &str) const
Writes ServiceInfo to stream in &quot;.service&quot; format.
Definition: ServiceInfo.cc:168
repo::ServiceType type() const
Definition: ServiceInfo.cc:104
RW_pointer supporting &#39;copy on write&#39; functionality.
Definition: PtrTypes.h:438