1 /* 2 * This source file is part of MyGUI. For the latest info, see http://mygui.info/ 3 * Distributed under the MIT License 4 * (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT) 5 */ 6 7 #ifndef MYGUI_EXCEPTION_H_ 8 #define MYGUI_EXCEPTION_H_ 9 10 #include "MyGUI_Prerequest.h" 11 #include <exception> 12 #include <string> 13 14 #if MYGUI_COMPILER == MYGUI_COMPILER_MSVC 15 // disable: warning C4275: non dll-interface class '***' used as base for dll-interface clas '***' 16 # pragma warning (push) 17 # pragma warning (disable : 4275) 18 #endif 19 20 namespace MyGUI 21 { 22 23 class MYGUI_EXPORT Exception : 24 public std::exception 25 { 26 public: 27 Exception(const std::string& _description, const std::string& _source, const char* _file, long _line); 28 29 Exception(const Exception& _rhs); 30 31 Exception& operator = (const Exception& _rhs); 32 33 virtual const std::string& getFullDescription() const; 34 35 virtual const std::string& getSource() const; 36 37 virtual const std::string& getFile() const; 38 39 virtual long getLine() const; 40 41 virtual const std::string& getDescription() const; 42 43 const char* what() const noexcept override; 44 45 protected: 46 std::string mDescription; 47 std::string mSource; 48 std::string mFile; 49 long mLine; 50 mutable std::string mFullDesc; 51 }; 52 53 } // namespace MyGUI 54 55 #if MYGUI_COMPILER == MYGUI_COMPILER_MSVC 56 # pragma warning (pop) 57 #endif 58 59 #endif // MYGUI_EXCEPTION_H_ 60