Enum typemaps taken out of java.swg
New typemap files for the different C/C++ to Java enum wrapping approaches. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5921 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
064082e9b5
commit
990156dff1
5 changed files with 234 additions and 19 deletions
39
Lib/java/enumsimple.swg
Normal file
39
Lib/java/enumsimple.swg
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
/* -----------------------------------------------------------------------------
|
||||
* This file provides backwards compatible enum wrapping. SWIG versions 1.3.21
|
||||
* and earlier wrapped global enums with constant integers in the module class
|
||||
* or Constants interface. Enums declared within a C++ class were wrapped by
|
||||
* constant integers in the Java proxy class.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
%typemap(jni) enum SWIGTYPE "jint"
|
||||
%typemap(jtype) enum SWIGTYPE "int"
|
||||
%typemap(jstype) enum SWIGTYPE "int"
|
||||
|
||||
%typemap(in) enum SWIGTYPE %{ $1 = ($1_ltype)$input; %}
|
||||
%typemap(out) enum SWIGTYPE %{ $result = (jint)$1; %}
|
||||
|
||||
%typemap(directorin, descriptor="I") enum SWIGTYPE "$input = (jint) $1;"
|
||||
%typemap(javadirectorin) enum SWIGTYPE "$jniinput"
|
||||
%typemap(javadirectorout) enum SWIGTYPE "$javacall"
|
||||
|
||||
%typecheck(SWIG_TYPECHECK_INT32) enum SWIGTYPE ""
|
||||
|
||||
%typemap(javain) enum SWIGTYPE "$javainput.swigValue()"
|
||||
%typemap(javaout) enum SWIGTYPE {
|
||||
return $javaclassname.swigToEnum($jnicall);
|
||||
}
|
||||
|
||||
%typemap(throws) enum SWIGTYPE {
|
||||
SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "C++ $1_type exception thrown");
|
||||
}
|
||||
|
||||
%typemap(javain) enum SWIGTYPE "$javainput"
|
||||
%typemap(javaout) enum SWIGTYPE {
|
||||
return $jnicall;
|
||||
}
|
||||
|
||||
%typemap(javaclassmodifiers) enum SWIGTYPE ""
|
||||
%typemap(javagetcptr) enum SWIGTYPE ""
|
||||
|
||||
%javaenum(simple);
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue