|
|
/*************************************************************************** * * File: CustomException.h * Created: Sat Dec 4 1999 * (C) 1999 by David M. <captjay@superlink.net> * ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #ifndef CUSTOMEXCEPTION_H #define CUSTOMEXCEPTION_H #include <qobject.h> #include <qstring.h> /** * @author David M. * @short Base class for the custom exception hierarchy. * * CustomException is a base class for a hierarchy of custom exceptions. * All exceptions inheriting from CustomException will handle a message() method * to get information on the error. * * All subclasses of CustomException should include the Q_OBJECT macro to * allow exception handling routines to determine the exact type of the exception object. * * Although it is possible, CustomException objects should not be instanciated directly. * Using subclasses allow alot more precision in error handling. **/ class CustomException: public QObject { Q_OBJECT public: /** * Default constructor. Creates a CustomException with the message "An error occured in the application". */ CustomException(); /** * Construct a CustomException object with an error message. * @param message The error message to display. The message should provide descriptive * information, as it may end up displayed to the user. */ CustomException(QString message); virtual ~CustomException(); /** * Get the error message of the CustomException object. Subclasses can override this method * to provide more detailed functionnality. * @return The error message included on construction of the object. */ virtual QString message() const; protected: QString _msg; }; #endif
Generated by: nightsky@centauri on Sat Jan 15 23:06:10 2000, using kdoc 2.0a30. |