00001 /*---------------------------------------------------------------------* 00002 | Library QgarLib, graphics analysis and recognition | 00003 | Copyright (C) 2003 Qgar Project, LORIA | 00004 | | 00005 | This library is free software; you can redistribute it and/or | 00006 | modify it under the terms of the GNU Lesser General Public | 00007 | License version 2.1, as published by the Free Software Foundation. | 00008 | | 00009 | This library is distributed in the hope that it will be useful, | 00010 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 00011 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 00012 | See the GNU Lesser General Public License for more details. | 00013 | | 00014 | The GNU Lesser General Public License is included in the file | 00015 | LICENSE.LGPL, in the root directory of the Qgar packaging. See | 00016 | http://www.gnu.org/licenses/lgpl.html for the terms of the license. | 00017 | To receive a paper copy, write to the Free Software Foundation, | 00018 | Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. | 00019 | | 00020 | Contact Project Qgar for any information: | 00021 | LORIA - équipe Qgar | 00022 | B.P. 239, 54506 Vandoeuvre-lès-Nancy Cedex, France | 00023 | email: qgar-contact@loria.fr | 00024 | http://www.qgar.org/ | 00025 *---------------------------------------------------------------------*/ 00026 00027 00028 #ifndef __SAXEXCEPTION_H_INCLUDED__ 00029 #define __SAXEXCEPTION_H_INCLUDED__ 00030 00031 00032 /** 00033 * @file SAXException.H 00034 * @brief Header file of class qgxml::SAXException 00035 * 00036 * @author <a href="mailto:qgar-contact@loria.fr?subject=Qgar fwd Jan Rendek">Jan Rendek</a> 00037 * @date March 10, 2003 11:14 00038 * @since Qgar 2.1.1 00039 */ 00040 00041 00042 // For RCS/CVS use: Do not delete 00043 /* $Id */ 00044 00045 00046 #include <stdexcept> 00047 00048 #include <string> 00049 00050 namespace qgxml 00051 { 00052 00053 /** 00054 * @class SAXException SAXException.H <qgarlib/sax/SAXException.H> 00055 * @ingroup XML 00056 * @brief Encapsulate a general SAX error or warning. 00057 * 00058 * <p> 00059 * This class can contain basic error or warning information from 00060 * either the XML parser or the application: a parser writer or 00061 * application writer can subclass it to provide additional 00062 * functionality. SAX handlers may throw this exception or any 00063 * exception subclassed from it. 00064 * </p> 00065 * <p> 00066 * <b> This class is an adaptation for C++ of the interface of the same 00067 * name implemented in the Java SAX API(http://www.saxproject.org). 00068 * </b> 00069 * </p> 00070 * 00071 * @author <a href="mailto:qgar-contact@loria.fr?subject=Qgar fwd Jan Rendek">Jan Rendek</a> (Adaptation) 00072 * @date March 10, 2003 11:14 00073 * @since Qgar 2.1.1 00074 * 00075 * @todo Implement the embedded exception. 00076 */ 00077 class SAXException : public std::runtime_error { 00078 00079 // ------------------------------------------------------------------- 00080 // P U B L I C M E M B E R S 00081 // ------------------------------------------------------------------- 00082 public: 00083 00084 /** @name Constructors */ 00085 // ============ 00086 //@{ 00087 00088 /** 00089 * Default Constructor 00090 */ 00091 SAXException() : std::runtime_error("Unknown Exception") 00092 { /* EMPTY */ } 00093 00094 /** 00095 * @brief Copy-Constructor 00096 */ 00097 SAXException(const SAXException& rhs) 00098 : std::runtime_error( rhs.what() ) 00099 { /* EMPTY */ } 00100 00101 /** 00102 * @brief Create a new SAXException. 00103 * 00104 * @param message The error or warning message. 00105 */ 00106 SAXException(const std::string& message) 00107 : std::runtime_error(message.c_str()) 00108 { /* EMPTY */ } 00109 00110 //@} 00111 00112 00113 00114 00115 /** @name Access */ 00116 // ====== 00117 //@{ 00118 00119 /** 00120 * @brief Return a detail message for this exception. 00121 * 00122 * @return The error or warning message. 00123 */ 00124 virtual const char * getMessage() 00125 { 00126 return what(); 00127 } 00128 00129 /** 00130 * @brief Return a detail message for this exception. 00131 * 00132 * @return The error or warning message. 00133 */ 00134 virtual const char * getMessage() const 00135 { 00136 return what(); 00137 } 00138 00139 //@} 00140 00141 00142 00143 00144 00145 00146 /** @name Destructor */ 00147 // ========== 00148 //@{ 00149 00150 /** 00151 * 00152 */ 00153 virtual ~SAXException() throw() { } 00154 00155 //@} 00156 00157 00158 }; // class SAXException 00159 00160 } // namespace qgxml 00161 00162 00163 #endif /* __SAXEXCEPTION_H_INCLUDED__ */ 00164