| Server IP : 103.234.187.230 / Your IP : 216.73.216.216 Web Server : Apache System : Linux lserver42043-ind.megavelocity.net 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64 User : apache ( 48) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/share/swig/2.0.10/ |
Upload File : |
/* -----------------------------------------------------------------------------
* std_except.i
*
* SWIG library file with typemaps to handle and throw STD exceptions in a
* language and STL independent way, i.e., the target language doesn't
* require to support STL but only the 'exception.i' mechanism.
*
* These typemaps are used when methods are declared with an STD
* exception specification, such as
*
* size_t at() const throw (std::out_of_range);
*
* The typemaps here are based on the language independent
* 'exception.i' library. If that is working in your target language,
* this file will work.
*
* If the target language doesn't implement a robust 'exception.i'
* mechanism, or you prefer other ways to map the STD exceptions, write
* a new std_except.i file in the target library directory.
* ----------------------------------------------------------------------------- */
#if defined(SWIGJAVA) || defined(SWIGCSHARP) || defined(SWIGGUILE) || defined(SWIGUTL) || defined(SWIGD)
#error "This version of std_except.i should not be used"
#endif
%{
#include <stdexcept>
%}
%include <exception.i>
%define %std_exception_map(Exception, Code)
%typemap(throws,noblock=1) Exception {
SWIG_exception(Code, $1.what());
}
%ignore Exception;
struct Exception {
};
%enddef
namespace std {
%std_exception_map(bad_exception, SWIG_SystemError);
%std_exception_map(domain_error, SWIG_ValueError);
%std_exception_map(exception, SWIG_SystemError);
%std_exception_map(invalid_argument, SWIG_ValueError);
%std_exception_map(length_error, SWIG_IndexError);
%std_exception_map(logic_error, SWIG_RuntimeError);
%std_exception_map(out_of_range, SWIG_IndexError);
%std_exception_map(overflow_error, SWIG_OverflowError);
%std_exception_map(range_error, SWIG_OverflowError);
%std_exception_map(runtime_error, SWIG_RuntimeError);
%std_exception_map(underflow_error, SWIG_OverflowError);
}