diff options
author | chai <chaifix@163.com> | 2018-11-16 00:24:51 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2018-11-16 00:24:51 +0800 |
commit | 831e814ce9bdb84e86c06c4a52008f6bdaaa00d6 (patch) | |
tree | f91fccc7d2628d6e0a39886134b2bb174f5eede4 /src/libjin/Common/je_exception.h | |
parent | 6dc75930fe5fe02f1af5489917752d315cf9e48f (diff) |
*合并master到minimal分支
Diffstat (limited to 'src/libjin/Common/je_exception.h')
-rw-r--r-- | src/libjin/Common/je_exception.h | 35 |
1 files changed, 29 insertions, 6 deletions
diff --git a/src/libjin/Common/je_exception.h b/src/libjin/Common/je_exception.h index 7c66af8..c319ebd 100644 --- a/src/libjin/Common/je_exception.h +++ b/src/libjin/Common/je_exception.h @@ -1,19 +1,42 @@ -#ifndef __JE_EXCEPTION_H -#define __JE_EXCEPTION_H +#ifndef __JE_EXCEPTION_H__ +#define __JE_EXCEPTION_H__ #include <exception> +#include <string> namespace JinEngine { /// - /// Built-in exception class. + /// Jin Exception. /// - class JinException : public std::exception + class Exception : public std::exception { public: - JinException(); - 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; }; |