gflib  1.0
prog/include/err/gfl_Exception.h
説明を見る。
00001 #ifndef __GFL_EXCEPTION_H__
00002 #define __GFL_EXCEPTION_H__
00003 
00004 #pragma once
00005 
00006 #include <nn.h>
00007 #include <exception>
00008 
00009 
00010 namespace gfl{
00011 namespace err{
00012 
00016 class Exception : public ::std::exception
00017 {
00018 protected:
00019   static const u32 MESSAGE_BUFFER_SIZE  = 256;
00020   static const u32 FILENAME_BUFFER_SIZE = 128;
00021   //
00022   char      m_message[MESSAGE_BUFFER_SIZE];      // 内部メッセージ用バッファ
00023   char      m_fileName[FILENAME_BUFFER_SIZE];    // エラー発生ファイル名用バッファ
00024   u32       m_line;                              // エラー発生ライン数
00025 
00026 public:
00036   // -----------------------------------------------------------------------
00037             Exception( const char * message = NULL, const char *fileName = NULL, u32 line = 0 );
00038 
00039 public:
00040 
00046   // -----------------------------------------------------------------------
00047   void      PrintStackTrace( void ) const;
00048 
00054   // -----------------------------------------------------------------------
00055   const char*  GetThrowsFileName( void ) const;
00056 
00062   // -----------------------------------------------------------------------
00063   u32       GetThrowsFileLine( void ) const;
00064 
00065 protected:
00066   void      SetMassage( const char *classHeader, const char* message );
00067 
00068 };
00069 
00070 } // err
00071 } // gfl
00072 
00073 #endif  // __GFL_EXCEPTION_H__