diff options
Diffstat (limited to 'src/libjin/Common/je_exception.h')
-rw-r--r-- | src/libjin/Common/je_exception.h | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/src/libjin/Common/je_exception.h b/src/libjin/Common/je_exception.h index cf11f51..c319ebd 100644 --- a/src/libjin/Common/je_exception.h +++ b/src/libjin/Common/je_exception.h @@ -2,18 +2,41 @@ #define __JE_EXCEPTION_H__ #include <exception> +#include <string> namespace JinEngine { /// - /// Built-in exception class. + /// Jin Exception. /// class Exception : public std::exception { public: - Exception(); - const char* what() const throw(); + + /// + /// Creates a new Exception according to printf-rules. + /// + /// @param fmt The format string (see printf). + /// + Exception(const char *fmt, ...); + virtual ~Exception() throw(); + + /// + /// Returns a string containing reason for the exception. + /// + /// @return A description of the exception. + /// + inline virtual const char *what() const throw() + { + return mMessage.c_str(); + } + + private: + /// + /// Exception message. + /// + std::string mMessage; }; |