OSDN Git Service

41965eab275f09d71a476883b978f611ed1c3bec
[winaudioj/stedx.git] / exception.h
1 #pragma once
2
3 namespace sf
4 {
5 ///Exception
6         class exception : public std::exception
7         {
8         public:
9                 explicit exception(const std::wstring& reason)
10                 {
11                         m_reason = reason;
12                 };
13                 const wchar_t * what() {return m_reason.c_str();};
14                 const std::wstring& what_str() { return m_reason;};
15         protected:
16                 std::wstring m_reason;
17         };
18
19         class win32_error_exception : std::exception 
20         {
21         public:
22                 win32_error_exception(boost::uint32_t hr);
23                 win32_error_exception();
24
25                 virtual ~win32_error_exception() {};
26                 boost::uint32_t hresult() {return hresult_;}
27                 std::wstring& error() {return error_;}
28         private:
29                 boost::uint32_t hresult_;
30                 std::wstring error_;
31         };
32
33
34 }