Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

QgarErrorIO.H

Go to the documentation of this file.
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 __QGARERRORIO_H_INCLUDED__
00029 #define __QGARERRORIO_H_INCLUDED__
00030 
00031 
00032 /**
00033  * @file    QgarErrorIO.H
00034  * @brief   Header file of class qgar::QgarErrorIO.
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: QgarErrorIO.H,v 1.9 2005/01/11 13:14:11 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  * @class QgarErrorIO QgarErrorIO.H "qgarlib/QgarErrorIO.H"
00060  * @ingroup ERROR
00061  * @brief Class for Qgar Input/Output exceptions.
00062  * 
00063  * @author  <a href="mailto:qgar-develop@loria.fr?subject=Qgar fwd Gerald Masini">Gerald Masini</a>
00064  * @date    November 12, 2003  16:02
00065  * @since   Qgar 2.1
00066  */
00067 class QgarErrorIO
00068 
00069   : public std::runtime_error,
00070     public AbstractQgarError
00071 
00072 {
00073 // -------------------------------------------------------------------
00074 // P U B L I C   M E M B E R S
00075 // -------------------------------------------------------------------
00076 public:
00077 
00078   /** @name Constructors */
00079   //        ============
00080   //@{
00081   /**
00082    * @brief Construct from the profile of the function throwing
00083    *        the exception, without displaying any error message.
00084    * @param aFuncProfile  profile of the function throwing the exception
00085    */
00086   QgarErrorIO(const char* aFuncProfile);
00087 
00088   /**
00089    * @brief Construct and display an error message.
00090    * @param aFileName     name of the file including the function throwing the exception
00091    * @param aLineNumber   line number (in the file) of the <b>throw</b> instruction
00092    * @param aFuncProfile  profile of the function throwing the exception
00093    * @param aDiagnostic   full explicit diagnostic
00094    *
00095    * An error message includes 4 lines:
00096    * - message header,  displayed by
00097    *   qgar::AbstractQgarError::displayErrorMessageHeader(const char*)
00098    * - file name and line number of the corresponding <b>throw</b> instruction
00099    * - function profile
00100    * - diagnostic
00101    */
00102   QgarErrorIO(const char* aFileName,
00103               int aLineNumber,
00104               const char* aFuncProfile,
00105               const std::string aDiagnostic);
00106   //@}
00107 
00108 
00109   /** @name Destructor */
00110   //        ==========
00111   //@{
00112   /**
00113    * @brief Virtual destructor.
00114    */
00115   virtual ~QgarErrorIO() throw();
00116   //@}
00117   
00118 // -------------------------------------------------------------------
00119 }; // class QgarErrorIO
00120 
00121 
00122 } // namespace qgar
00123 
00124 #endif /* __QGARERRORIO_H_INCLUDED__ */