home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ool_main.zip / ool / include / xexcept.h < prev    next >
C/C++ Source or Header  |  1998-04-06  |  1KB  |  36 lines

  1. #ifndef __OOL_XEXCEPT_H__
  2. #define __OOL_XEXCEPT_H__
  3.  
  4. /*===========================================================================*/
  5. /* OOL ------------------- the Open Object Library ------------------- r 1.0 */
  6. /*===========================================================================*/
  7. /*                              class: XException                            */
  8. /*                       derived from: XObject                               */
  9. /*                        last update: 5/97                                  */
  10. /*                      programmed by: Stefan von Brauk (sbrauk@gwdg.de)     */
  11. /*===========================================================================*/
  12.  
  13. #include "xobject.h"
  14. #include "xstring.h"
  15. #include <stdio.h>
  16.  
  17. class XWindow;
  18.  
  19.  
  20. class _export_ XException
  21. {
  22.       XString msg, file;
  23.       LONG code, line;
  24.    public:
  25.       XException(const char * errorMsg, const LONG errorCode, const LONG lineNumber=0, const char * fileName="")
  26.             { msg = errorMsg; code = errorCode; line = lineNumber; file = fileName; }
  27.       char * GetErrorMessage(void) const { return (char*) msg; }
  28.       LONG GetErrorCode(void) const { return code; }
  29.       void ShowError( const XWindow * w=NULL) const ;
  30.       void PrintError(void) const ;
  31. };
  32.  
  33. #define OOLThrow(a, b) throw( XException(a, b, __LINE__, __FILE__))
  34.  
  35. #endif
  36.