| 1 | // LAF Base Library |
| 2 | // Copyright (c) 2021 Igara Studio S.A. |
| 3 | // Copyright (c) 2001-2016 David Capello |
| 4 | // |
| 5 | // This file is released under the terms of the MIT license. |
| 6 | // Read LICENSE.txt for more information. |
| 7 | |
| 8 | #ifndef BASE_EXCEPTION_H_INCLUDED |
| 9 | #define BASE_EXCEPTION_H_INCLUDED |
| 10 | #pragma once |
| 11 | |
| 12 | #include <exception> |
| 13 | #include <string> |
| 14 | |
| 15 | namespace base { |
| 16 | |
| 17 | class Exception : public std::exception { |
| 18 | public: |
| 19 | Exception() throw(); |
| 20 | Exception(const char* format, ...) throw(); |
| 21 | Exception(const std::string& msg) throw(); |
| 22 | virtual ~Exception() throw(); |
| 23 | |
| 24 | const char* what() const throw() override; |
| 25 | |
| 26 | protected: |
| 27 | void setMessage(const char* msg) throw(); |
| 28 | |
| 29 | private: |
| 30 | std::string m_msg; |
| 31 | }; |
| 32 | |
| 33 | } |
| 34 | |
| 35 | #endif |
| 36 | |