libzypp
10.5.0
|
00001 /*---------------------------------------------------------------------\ 00002 | ____ _ __ __ ___ | 00003 | |__ / \ / / . \ . \ | 00004 | / / \ V /| _/ _/ | 00005 | / /__ | | | | | | | 00006 | /_____||_| |_| |_| | 00007 | | 00008 \---------------------------------------------------------------------*/ 00012 #ifndef ZYPP_SERVICE_H 00013 #define ZYPP_SERVICE_H 00014 00015 #include <set> 00016 #include <string> 00017 00018 #include "zypp/Url.h" 00019 00020 #include "zypp/repo/ServiceType.h" 00021 #include "zypp/repo/RepoInfoBase.h" 00022 00023 00025 namespace zypp 00026 { 00027 00029 // 00030 // CLASS NAME : ServiceInfo 00031 // 00033 class ServiceInfo : public repo::RepoInfoBase 00034 { 00035 public: 00037 ServiceInfo(); 00038 00044 ServiceInfo( const std::string & alias ); 00045 00052 ServiceInfo( const std::string & alias, const Url& url ); 00053 00054 virtual ~ServiceInfo(); 00055 00056 public: 00058 static const ServiceInfo noService; 00059 00060 public: 00061 00067 Url url() const; 00068 00074 void setUrl( const Url& url ); 00075 00079 repo::ServiceType type() const; 00080 00086 void setType( const repo::ServiceType & type ); 00087 00088 void setProbedType( const repo::ServiceType & t ) const; 00089 00090 00099 typedef std::set<std::string> ReposToEnable; 00100 bool reposToEnableEmpty() const; 00101 ReposToEnable::size_type reposToEnableSize() const; 00102 ReposToEnable::const_iterator reposToEnableBegin() const; 00103 ReposToEnable::const_iterator reposToEnableEnd() const; 00104 00106 bool repoToEnableFind( const std::string & alias_r ) const; 00107 00109 void addRepoToEnable( const std::string & alias_r ); 00111 void delRepoToEnable( const std::string & alias_r ); 00113 void clearReposToEnable(); 00115 00123 typedef std::set<std::string> ReposToDisable; 00124 bool reposToDisableEmpty() const; 00125 ReposToDisable::size_type reposToDisableSize() const; 00126 ReposToDisable::const_iterator reposToDisableBegin() const; 00127 ReposToDisable::const_iterator reposToDisableEnd() const; 00128 00130 bool repoToDisableFind( const std::string & alias_r ) const; 00131 00133 void addRepoToDisable( const std::string & alias_r ); 00135 void delRepoToDisable( const std::string & alias_r ); 00137 void clearReposToDisable(); 00139 00140 public: 00146 virtual std::ostream & dumpAsIniOn( std::ostream & str ) const; 00147 00151 virtual std::ostream & dumpAsXMLOn(std::ostream & str) const; 00152 00160 virtual std::ostream & dumpAsXMLOn( 00161 std::ostream & str, const std::string & content) const; 00162 00163 class Impl; 00164 00165 private: 00166 RWCOW_pointer<Impl> _pimpl; 00167 }; 00169 00171 typedef shared_ptr<ServiceInfo> ServiceInfo_Ptr; 00173 typedef shared_ptr<const ServiceInfo> ServiceInfo_constPtr; 00175 typedef std::list<ServiceInfo> ServiceInfoList; 00176 00178 std::ostream & operator<<( std::ostream & str, const ServiceInfo & obj ); 00179 00180 00182 } // namespace zypp 00184 #endif // ZYPP_SAT_REPOSITORY_H