Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

Fl_Exception.h

00001 /*
00002  * $Id: Fl_Exception.h,v 1.11 2003/02/28 23:52:04 laza2000 Exp $
00003  *
00004  * Extended Fast Light Toolkit (EFLTK)
00005  * Copyright (C) 2002-2003 by EDE-Team
00006  * WWW: http://www.sourceforge.net/projects/ede
00007  *
00008  * Fast Light Toolkit (FLTK)
00009  * Copyright (C) 1998-2003 by Bill Spitzak and others.
00010  * WWW: http://www.fltk.org
00011  *
00012  * This library is distributed under the GNU LIBRARY GENERAL PUBLIC LICENSE
00013  * version 2. See COPYING for details.
00014  *
00015  * Author : Mikko Lahteenmaki
00016  * Email  : mikko@fltk.net
00017  *
00018  * Please report all bugs and problems to "efltk-bugs@fltk.net"
00019  *
00020  */
00021 
00022 #ifndef _FL_EXCEPTION_H_
00023 #define _FL_EXCEPTION_H_
00024 
00025 #include "Fl_String.h"
00026 #include "Fl_Export.h"
00027 
00032 class FL_API Fl_Exception {
00033 public:
00034     Fl_Exception(const char *text="", const char *file="", int line=0);
00035 
00042     Fl_String text(bool short_version=false) const;
00043 
00044 protected:
00045     Fl_String m_text;
00046     const char *m_file;
00047     int m_line;
00048 };
00049 
00050 // Shortcut for easier throwing
00051 #define fl_throw(text) throw Fl_Exception(text, __FILE__, __LINE__)
00052 
00053 /*
00054  * Backward compatibility..
00055  * Emulate std C++ exception interface
00056  */
00057 #define fl_try try
00058 #define fl_catch(exception_variable) catch(Fl_Exception& exception_variable)
00059 #define fl_throw_(text, file, line) throw Fl_Exception(text, file, line);
00060 #define fl_rethrow throw
00061 
00062 #endif

Generated on Thu Jul 31 15:33:43 2003 for eFLTK by doxygen1.2.15