PageRenderTime 35ms CodeModel.GetById 10ms RepoModel.GetById 0ms app.codeStats 0ms

/tags/rel-1-3-25/SWIG/Lib/std/std_except.i

#
Swig | 79 lines | 64 code | 14 blank | 1 comment | 0 complexity | 46c42907792ca93ce6a528ab46846557 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. %include <std_string.i>
  2. %include <exception.i>
  3. %{
  4. #include <stdexcept>
  5. %}
  6. namespace std {
  7. /* Mark all of them as exception classes */
  8. %feature("exceptionclass") exception;
  9. %feature("exceptionclass") bad_exception;
  10. %feature("exceptionclass") logic_error;
  11. %feature("exceptionclass") domain_error;
  12. %feature("exceptionclass") invalid_argument;
  13. %feature("exceptionclass") length_error;
  14. %feature("exceptionclass") out_of_range;
  15. %feature("exceptionclass") runtime_error;
  16. %feature("exceptionclass") range_error;
  17. %feature("exceptionclass") overflow_error;
  18. %feature("exceptionclass") underflow_error;
  19. }
  20. namespace std {
  21. struct exception
  22. {
  23. virtual ~exception() throw();
  24. virtual const char* what() const throw();
  25. };
  26. struct bad_exception : exception
  27. {
  28. };
  29. struct logic_error : exception
  30. {
  31. logic_error(const string& msg);
  32. };
  33. struct domain_error : logic_error
  34. {
  35. domain_error(const string& msg);
  36. };
  37. struct invalid_argument : logic_error
  38. {
  39. invalid_argument(const string& msg);
  40. };
  41. struct length_error : logic_error
  42. {
  43. length_error(const string& msg);
  44. };
  45. struct out_of_range : logic_error
  46. {
  47. out_of_range(const string& msg);
  48. };
  49. struct runtime_error : exception
  50. {
  51. runtime_error(const string& msg);
  52. };
  53. struct range_error : runtime_error
  54. {
  55. range_error(const string& msg);
  56. };
  57. struct overflow_error : runtime_error
  58. {
  59. overflow_error(const string& msg);
  60. };
  61. struct underflow_error : runtime_error
  62. {
  63. underflow_error(const string& msg);
  64. };
  65. }