00001 /* vim: set sw=4 sts=4 et foldmethod=syntax : */ 00002 00003 /* 00004 * Copyright (c) 2005, 2006, 2007, 2008 Ciaran McCreesh 00005 * 00006 * This file is part of the Paludis package manager. Paludis is free software; 00007 * you can redistribute it and/or modify it under the terms of the GNU General 00008 * Public License version 2, as published by the Free Software Foundation. 00009 * 00010 * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY 00011 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 00012 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 00013 * details. 00014 * 00015 * You should have received a copy of the GNU General Public License along with 00016 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple 00017 * Place, Suite 330, Boston, MA 02111-1307 USA 00018 */ 00019 00020 #ifndef PALUDIS_GUARD_PALUDIS_DEP_LIST_EXCEPTIONS_HH 00021 #define PALUDIS_GUARD_PALUDIS_DEP_LIST_EXCEPTIONS_HH 1 00022 00023 #include <paludis/util/exception.hh> 00024 #include <paludis/package_database.hh> 00025 #include <paludis/environment.hh> 00026 00027 /** \file 00028 * Declarations for DepList exceptions. 00029 * 00030 * \ingroup g_dep_spec 00031 * 00032 * \section Examples 00033 * 00034 * - None at this time. 00035 */ 00036 00037 namespace paludis 00038 { 00039 /** 00040 * Thrown if an error occurs whilst building a DepList. 00041 * 00042 * \ingroup g_dep_list 00043 * \ingroup g_exceptions 00044 * \nosubgrouping 00045 */ 00046 class PALUDIS_VISIBLE DepListError : public Exception 00047 { 00048 protected: 00049 ///\name Basic operations 00050 ///\{ 00051 00052 DepListError(const std::string &) throw (); 00053 00054 ///\} 00055 }; 00056 00057 /** 00058 * Thrown if all versions of a particular spec are masked. 00059 * 00060 * \ingroup g_dep_list 00061 * \ingroup g_exceptions 00062 * \nosubgrouping 00063 */ 00064 class PALUDIS_VISIBLE AllMaskedError : public DepListError 00065 { 00066 private: 00067 const PackageDepSpec _query; 00068 00069 public: 00070 ///\name Basic operations 00071 ///\{ 00072 00073 AllMaskedError(const PackageDepSpec & query) throw (); 00074 00075 virtual ~AllMaskedError() throw () 00076 { 00077 } 00078 00079 ///\} 00080 00081 /** 00082 * Our query. 00083 */ 00084 const PackageDepSpec query() const 00085 { 00086 return _query; 00087 } 00088 }; 00089 00090 /** 00091 * Thrown if all versions of a particular spec are masked, 00092 * but would not be if additional requirements were not in effect. 00093 * 00094 * \ingroup g_dep_list 00095 * \ingroup g_exceptions 00096 * \nosubgrouping 00097 */ 00098 class PALUDIS_VISIBLE AdditionalRequirementsNotMetError : public DepListError 00099 { 00100 private: 00101 PackageDepSpec _query; 00102 00103 public: 00104 ///\name Basic operations 00105 ///\{ 00106 00107 AdditionalRequirementsNotMetError(const PackageDepSpec & query) throw (); 00108 00109 virtual ~AdditionalRequirementsNotMetError() throw (); 00110 00111 ///\} 00112 00113 /** 00114 * Our query. 00115 */ 00116 const PackageDepSpec query() const 00117 { 00118 return _query; 00119 } 00120 }; 00121 00122 /** 00123 * Thrown if a downgrade is forced and we're not allowed to downgrade. 00124 * 00125 * \ingroup g_exceptions 00126 * \ingroup g_dep_list 00127 * \nosubgrouping 00128 */ 00129 class PALUDIS_VISIBLE DowngradeNotAllowedError : public DepListError 00130 { 00131 public: 00132 ///\name Basic operations 00133 ///\{ 00134 00135 DowngradeNotAllowedError(const std::string & to, const std::string & from) throw (); 00136 00137 virtual ~DowngradeNotAllowedError() throw (); 00138 00139 ///\} 00140 }; 00141 00142 /** 00143 * Thrown if a block is encountered. 00144 * 00145 * \ingroup g_exceptions 00146 * \ingroup g_dep_list 00147 * \nosubgrouping 00148 */ 00149 class PALUDIS_VISIBLE BlockError : public DepListError 00150 { 00151 public: 00152 ///\name Basic operations 00153 ///\{ 00154 00155 BlockError(const std::string & msg) throw (); 00156 00157 ///\} 00158 }; 00159 00160 /** 00161 * Thrown if a circular dependency is encountered. 00162 * 00163 * \ingroup g_dep_list 00164 * \ingroup g_exceptions 00165 * \nosubgrouping 00166 */ 00167 class PALUDIS_VISIBLE CircularDependencyError : public DepListError 00168 { 00169 public: 00170 ///\name Basic operations 00171 ///\{ 00172 00173 CircularDependencyError(const std::string & msg) throw (); 00174 00175 ///\} 00176 }; 00177 00178 /** 00179 * Thrown if no destination can be found. 00180 * 00181 * \ingroup g_dep_list 00182 * \ingroup g_exceptions 00183 * \nosubgrouping 00184 */ 00185 class PALUDIS_VISIBLE NoDestinationError : public DepListError 00186 { 00187 public: 00188 ///\name Basic operations 00189 ///\{ 00190 00191 NoDestinationError(const PackageID &, 00192 const std::tr1::shared_ptr<const DestinationsSet> &) throw (); 00193 00194 ///\} 00195 }; 00196 } 00197 00198 #endif