00001 /*---------------------------------------------------------------------+ 00002 | Library QgarLib, graphics analysis and recognition | 00003 | Copyright (C) 2002 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 licence. | 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 __QGARERRORUSER_H_INCLUDED__ 00029 #define __QGARERRORUSER_H_INCLUDED__ 00030 00031 00032 /** 00033 * @file QgarErrorUser.H 00034 * @brief Header file of class qgar::QgarErrorUser. 00035 * 00036 * @author <a href="mailto:qgar-develop@loria.fr?subject=Qgar fwd Gerald Masini">Gerald Masini</a> 00037 * @date November 12, 2003 16:02 00038 * @since Qgar 2.1 00039 */ 00040 00041 00042 // For RCS/CVS use: Do not delete 00043 /* $Id: QgarErrorUser.H,v 1.9 2005/10/17 15:32:36 masini Exp $ */ 00044 00045 00046 00047 // STL 00048 #include <stdexcept> 00049 #include <string> 00050 // QGAR 00051 #include <qgarlib/AbstractQgarError.H> 00052 00053 00054 00055 namespace qgar 00056 { 00057 00058 00059 /** 00060 * @ingroup ERROR 00061 * 00062 * @class rQgarErrorUser QgarErrorUser.H "qgarlib/QgarErrorUser.H" 00063 * 00064 * @brief Class for Qgar user exceptions. 00065 * 00066 * A user exception is raised because of programming errors: 00067 * Index out of range, file opened in a wrong mode, etc. 00068 * 00069 * @author <a href="mailto:qgar-develop@loria.fr?subject=Qgar fwd Gerald Masini">Gerald Masini</a> 00070 * @date November 12, 2003 16:02 00071 * @since Qgar 2.1 00072 */ 00073 class QgarErrorUser 00074 00075 : public std::logic_error, 00076 public AbstractQgarError 00077 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 * @brief Construct from the profile of the function throwing 00090 * the exception, without displaying any error message. 00091 * 00092 * @param aFuncProfile profile of the function throwing the exception 00093 */ 00094 QgarErrorUser(const char* aFuncProfile); 00095 00096 /** 00097 * @brief Construct and display an error message. 00098 * 00099 * An error message includes 4 lines: 00100 * - message header, displayed by 00101 * qgar::AbstractQgarError::displayErrorMessageHeader(const char*) 00102 * - file name and line number of the corresponding <b>throw</b> instruction 00103 * - function profile 00104 * - diagnostic 00105 * 00106 * @param aFileName name of the file including the function throwing the exception 00107 * @param aLineNumber line number (in the file) of the <b>throw</b> instruction 00108 * @param aFuncProfile profile of the function throwing the exception 00109 * @param aDiagnostic full explicit diagnostic 00110 */ 00111 QgarErrorUser(const char* aFileName, 00112 int aLineNumber, 00113 const char* aFuncProfile, 00114 const std::string aDiagnostic); 00115 00116 //@} 00117 00118 00119 /** @name Destructor */ 00120 // ========== 00121 //@{ 00122 00123 /** 00124 * @brief Virtual destructor. 00125 */ 00126 virtual ~QgarErrorUser() throw(); 00127 00128 //@} 00129 00130 // ------------------------------------------------------------------- 00131 }; // class QgarErrorUser 00132 00133 00134 } // namespace qgar 00135 00136 00137 #endif /* __QGARERRORUSER_H_INCLUDED__ */