aboutsummaryrefslogtreecommitdiff
path: root/src/libjin/Common/je_exception.h
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2018-11-03 21:11:41 +0800
committerchai <chaifix@163.com>2018-11-03 21:11:41 +0800
commit281f8feabffd69928a0a0f08aa31f70b36f5e6bd (patch)
treea22413447a5480a5dffe625c677ad7c4140350c5 /src/libjin/Common/je_exception.h
parentf6ef5d6c0188e7dc6b39803ca37fe736f0eb3962 (diff)
*增加游戏目录选择
Diffstat (limited to 'src/libjin/Common/je_exception.h')
-rw-r--r--src/libjin/Common/je_exception.h29
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;
};