00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #if !defined( __Utils_SALOME_Exception_hxx__ )
00029 #define __Utils_SALOME_Exception_hxx__
00030
00031
00032
00033 # include <exception>
00034 # include <iostream>
00035
00036 #ifdef LOCALIZED
00037 #undef LOCALIZED
00038 #endif
00039 #if defined(_DEBUG_) || defined(_DEBUG)
00040 # define LOCALIZED(message) #message , __FILE__ , __LINE__
00041 #else
00042 # define LOCALIZED(message) #message
00043 #endif
00044
00045
00046
00047
00048 #ifdef WIN32
00049 # if defined UTILS_EXPORTS || defined OpUtil_EXPORTS
00050 # define UTILS_EXPORT __declspec( dllexport )
00051 # else
00052 # define UTILS_EXPORT __declspec( dllimport )
00053 # define LOCALIZED(message) #message
00054 # endif
00055 #else
00056 # define UTILS_EXPORT
00057 #endif
00058
00059 class SALOME_Exception;
00060
00061 UTILS_EXPORT std::ostream& operator<<( std::ostream&, const SALOME_Exception& );
00062
00063 UTILS_EXPORT const char *makeText( const char *text, const char *fileName, const unsigned int lineNumber );
00064
00065 class UTILS_EXPORT SALOME_Exception : public std::exception
00066 {
00067
00068 private :
00069 SALOME_Exception( void );
00070
00071 protected :
00072 const char* _text ;
00073
00074 public :
00075 SALOME_Exception( const char *text, const char *fileName=0, const unsigned int lineNumber=0 );
00076 SALOME_Exception( const SALOME_Exception &ex );
00077 virtual ~SALOME_Exception() throw ();
00078 friend std::ostream & operator<<( std::ostream &os , const SALOME_Exception &ex );
00079 virtual const char *what( void ) const throw () ;
00080 } ;
00081
00082
00083 #endif