aboutsummaryrefslogtreecommitdiff
path: root/src/libjin/Common/je_exception.h
blob: c319ebd6656619b2b798294f989ea1d00432f1d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#ifndef __JE_EXCEPTION_H__
#define __JE_EXCEPTION_H__

#include <exception>
#include <string>

namespace JinEngine
{

    ///
    /// Jin Exception.
    ///
    class Exception : public std::exception
    {
    public:

        /// 
        /// 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;

    };

} // namespace JinEngine

#endif