Go to the documentation of this file.00001 #ifndef __NITRO_EXCEPTION_H__
00002 #define __NITRO_EXCEPTION_H__
00003
00004 #include <algorithm>
00005 #include <string>
00006
00007 #if !defined( WIN32_PLATFORM ) && !defined( NIX_PLATFORM ) && !defined( MINGW_PLATFORM ) && !defined( CYGWIN_PLATFORM )
00008 #define WIN32_PLATFORM
00009 #endif
00010
00011 #ifdef EXCEPTION
00012 #if defined( WIN32_PLATFORM ) || defined( MINGW_PLATFORM ) || defined( CYGWIN_PLATFORM )
00013 #define EXCEPTION_DLL_ENTITY __declspec( dllexport )
00014 #endif
00015
00016 #if defined( NIX_PLATFORM )
00017 #define EXCEPTION_DLL_ENTITY
00018 #endif
00019 #else
00020 #if defined( WIN32_PLATFORM )
00021 #define EXCEPTION_DLL_ENTITY __declspec( dllimport )
00022 #pragma comment( lib , "exception.lib" )
00023 #endif
00024
00025 #if defined( CYGWIN_PLATFORM ) || defined( MINGW_PLATFORM )
00026 #define EXCEPTION_DLL_ENTITY __declspec( dllimport )
00027 #endif
00028
00029 #if defined( NIX_PLATFORM )
00030 #define EXCEPTION_DLL_ENTITY
00031 #endif
00032 #endif
00033
00034 namespace nitro
00035 {
00036 const std::size_t EXCEPTION_MESSAGE_LENGTH = 1024;
00037
00050 class EXCEPTION_DLL_ENTITY exception{
00051 public:
00052
00063 exception( void );
00064
00083
00084
00103 exception( const std::string & theWhatInfo , int theCodeInfo );
00104
00119 virtual const char * what( void ) const;
00120
00135 virtual int code( void ) const;
00136
00147 virtual ~exception();
00148
00149 private:
00150
00161 char WhatInfo[ EXCEPTION_MESSAGE_LENGTH ];
00162
00173 int CodeInfo;
00174 };
00175 }
00176
00177 #endif