add std_except.i
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6203 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
dcf2698c4b
commit
0017b084aa
2 changed files with 85 additions and 0 deletions
63
Lib/python/std_except.i
Normal file
63
Lib/python/std_except.i
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
%include <std_string.i>
|
||||
%include <exception.i>
|
||||
|
||||
%{
|
||||
#include <stdexcept>
|
||||
%}
|
||||
|
||||
namespace std {
|
||||
struct exception
|
||||
{
|
||||
virtual ~exception() throw();
|
||||
virtual const char* what() const throw();
|
||||
};
|
||||
|
||||
struct bad_exception : exception
|
||||
{
|
||||
};
|
||||
|
||||
struct logic_error : exception
|
||||
{
|
||||
explicit logic_error(const string& msg);
|
||||
};
|
||||
|
||||
struct domain_error : logic_error
|
||||
{
|
||||
explicit domain_error(const string& msg);
|
||||
};
|
||||
|
||||
struct invalid_argument : logic_error
|
||||
{
|
||||
explicit invalid_argument(const string& msg);
|
||||
};
|
||||
|
||||
struct length_error : logic_error
|
||||
{
|
||||
explicit length_error(const string& msg);
|
||||
};
|
||||
|
||||
struct out_of_range : logic_error
|
||||
{
|
||||
explicit out_of_range(const string& msg);
|
||||
};
|
||||
|
||||
struct runtime_error : exception
|
||||
{
|
||||
explicit runtime_error(const string& msg);
|
||||
};
|
||||
|
||||
struct range_error : runtime_error
|
||||
{
|
||||
explicit range_error(const string& msg);
|
||||
};
|
||||
|
||||
struct overflow_error : runtime_error
|
||||
{
|
||||
explicit overflow_error(const string& msg);
|
||||
};
|
||||
|
||||
struct underflow_error : runtime_error
|
||||
{
|
||||
explicit underflow_error(const string& msg);
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue