libzypp
10.5.0
|
00001 /*---------------------------------------------------------------------\ 00002 | ____ _ __ __ ___ | 00003 | |__ / \ / / . \ . \ | 00004 | / / \ V /| _/ _/ | 00005 | / /__ | | | | | | | 00006 | /_____||_| |_| |_| | 00007 | | 00008 \---------------------------------------------------------------------*/ 00012 #ifndef ZYPP_REPO_REPOEXCEPTION_H 00013 #define ZYPP_REPO_REPOEXCEPTION_H 00014 00015 #include <iosfwd> 00016 #include <string> 00017 00018 #include "zypp/base/Exception.h" 00019 #include "zypp/base/UserRequestException.h" 00020 #include "zypp/RepoInfo.h" 00021 #include "zypp/ServiceInfo.h" 00022 00024 namespace zypp 00025 { 00026 00027 namespace repo 00028 { 00029 00033 00037 class RepoException : public Exception 00038 { 00039 public: 00040 RepoException(); 00041 RepoException( const std::string & msg_r ); 00042 RepoException( const RepoInfo & info ); 00043 RepoException( const RepoInfo & info, const std::string & msg_r ); 00044 virtual ~RepoException() throw(); 00045 00046 RepoInfo info() 00047 { return _info; } 00048 00049 std::string alias() 00050 { return info().alias(); } 00051 00052 protected: 00053 virtual std::ostream & dumpOn( std::ostream & str ) const; 00054 00055 private: 00056 RepoInfo _info; 00057 }; 00059 00065 class RepoNotCachedException : public RepoException 00066 { 00067 public: 00068 RepoNotCachedException(); 00069 RepoNotCachedException( const std::string & msg_r ); 00070 RepoNotCachedException( const RepoInfo & info ); 00071 RepoNotCachedException( const RepoInfo & info, const std::string & msg_r ); 00072 }; 00073 00078 class RepoNoUrlException : public RepoException 00079 { 00080 public: 00081 RepoNoUrlException(); 00082 RepoNoUrlException( const std::string & msg_r ); 00083 RepoNoUrlException( const RepoInfo & info ); 00084 RepoNoUrlException( const RepoInfo & info, const std::string & msg_r ); 00085 }; 00086 00091 class RepoNoAliasException : public RepoException 00092 { 00093 public: 00094 RepoNoAliasException(); 00095 RepoNoAliasException( const std::string & msg_r ); 00096 RepoNoAliasException( const RepoInfo & info ); 00097 RepoNoAliasException( const RepoInfo & info, const std::string & msg_r ); 00098 }; 00099 00103 class RepoInvalidAliasException : public RepoException 00104 { 00105 public: 00106 RepoInvalidAliasException(); 00107 RepoInvalidAliasException( const std::string & msg_r ); 00108 RepoInvalidAliasException( const RepoInfo & info ); 00109 RepoInvalidAliasException( const RepoInfo & info, const std::string & msg_r ); 00110 }; 00111 00116 class RepoNotFoundException : public RepoException 00117 { 00118 public: 00119 RepoNotFoundException(); 00120 RepoNotFoundException( const std::string & msg_r ); 00121 RepoNotFoundException( const RepoInfo & info ); 00122 RepoNotFoundException( const RepoInfo & info, const std::string & msg_r ); 00123 }; 00124 00129 class RepoAlreadyExistsException : public RepoException 00130 { 00131 public: 00132 RepoAlreadyExistsException(); 00133 RepoAlreadyExistsException( const std::string & msg_r ); 00134 RepoAlreadyExistsException( const RepoInfo & info ); 00135 RepoAlreadyExistsException( const RepoInfo & info, const std::string & msg_r ); 00136 }; 00137 00142 class RepoUnknownTypeException : public RepoException 00143 { 00144 public: 00145 RepoUnknownTypeException(); 00146 RepoUnknownTypeException( const std::string & msg_r ); 00147 RepoUnknownTypeException( const RepoInfo & info ); 00148 RepoUnknownTypeException( const RepoInfo & info, const std::string & msg_r ); 00149 }; 00150 00155 class RepoMetadataException : public RepoException 00156 { 00157 public: 00158 RepoMetadataException(); 00159 RepoMetadataException( const std::string & msg_r ); 00160 RepoMetadataException( const RepoInfo & info ); 00161 RepoMetadataException( const RepoInfo & info, const std::string & msg_r ); 00162 }; 00163 00165 00166 00167 00168 00172 00175 class ServiceException : public Exception 00176 { 00177 public: 00178 ServiceException(); 00179 ServiceException( const std::string & msg_r ); 00180 ServiceException( const ServiceInfo & service_r ); 00181 ServiceException( const ServiceInfo & service_r, const std::string & msg_r ); 00182 virtual ~ServiceException() throw(); 00183 00184 ServiceInfo service() 00185 { return _service; } 00186 00187 std::string alias() 00188 { return service().alias(); } 00189 00190 protected: 00191 virtual std::ostream & dumpOn( std::ostream & str ) const; 00192 00193 private: 00194 ServiceInfo _service; 00195 }; 00197 00200 class ServiceNoAliasException : public ServiceException 00201 { 00202 public: 00203 ServiceNoAliasException(); 00204 ServiceNoAliasException( const std::string & msg_r ); 00205 ServiceNoAliasException( const ServiceInfo & service_r ); 00206 ServiceNoAliasException( const ServiceInfo & service_r, const std::string & msg_r ); 00207 }; 00208 00212 class ServiceInvalidAliasException : public ServiceException 00213 { 00214 public: 00215 ServiceInvalidAliasException(); 00216 ServiceInvalidAliasException( const std::string & msg_r ); 00217 ServiceInvalidAliasException( const ServiceInfo & info ); 00218 ServiceInvalidAliasException( const ServiceInfo & info, const std::string & msg_r ); 00219 }; 00220 00223 class ServiceAlreadyExistsException : public ServiceException 00224 { 00225 public: 00226 ServiceAlreadyExistsException(); 00227 ServiceAlreadyExistsException( const std::string & msg_r ); 00228 ServiceAlreadyExistsException( const ServiceInfo & service_r ); 00229 ServiceAlreadyExistsException( const ServiceInfo & service_r, const std::string & msg_r ); 00230 }; 00231 00234 class ServiceNoUrlException : public ServiceException 00235 { 00236 public: 00237 ServiceNoUrlException(); 00238 ServiceNoUrlException( const std::string & msg_r ); 00239 ServiceNoUrlException( const ServiceInfo & service_r ); 00240 ServiceNoUrlException( const ServiceInfo & service_r, const std::string & msg_r ); 00241 }; 00242 00245 class ServicePluginInformalException : public ServiceException 00246 { 00247 public: 00248 ServicePluginInformalException(); 00249 ServicePluginInformalException( const std::string & msg_r ); 00250 ServicePluginInformalException( const ServiceInfo & service_r ); 00251 ServicePluginInformalException( const ServiceInfo & service_r, const std::string & msg_r ); 00252 }; 00253 00255 00257 } // namespace repo 00260 } // namespace zypp 00262 #endif // ZYPP_PARSER_TAGFILE_PARSEEXCEPTION_H