MyGUI
3.2.1
|
00001 /* 00002 * This source file is part of MyGUI. For the latest info, see http://mygui.info/ 00003 * Distributed under the MIT License 00004 * (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT) 00005 */ 00006 00007 #ifndef __MYGUI_EXCEPTION_H__ 00008 #define __MYGUI_EXCEPTION_H__ 00009 00010 #include "MyGUI_Prerequest.h" 00011 #include <exception> 00012 #include <string> 00013 00014 namespace MyGUI 00015 { 00016 00017 class MYGUI_EXPORT Exception : 00018 public std::exception 00019 { 00020 public: 00021 Exception(const std::string& _description, const std::string& _source, const char* _file, long _line); 00022 00023 Exception(const Exception& _rhs); 00024 00025 // Needed for compatibility with std::exception 00026 ~Exception() throw(); 00027 00028 Exception& operator = (const Exception& _rhs); 00029 00030 virtual const std::string& getFullDescription() const; 00031 00032 virtual const std::string& getSource() const; 00033 00034 virtual const std::string& getFile() const; 00035 00036 virtual long getLine() const; 00037 00038 virtual const std::string& getDescription() const; 00039 00040 // Override std::exception::what 00041 const char* what() const throw(); 00042 00043 protected: 00044 std::string mDescription; 00045 std::string mSource; 00046 std::string mFile; 00047 long mLine; 00048 mutable std::string mFullDesc; 00049 }; 00050 00051 } // namespace MyGUI 00052 00053 #endif // __MYGUI_EXCEPTION_H__