Enum typemaps taken out of csharp.swg.
New typemap files for the different C/C++ to C# enum wrapping approaches. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5920 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
b84a6d58b4
commit
5767cdfa94
4 changed files with 141 additions and 23 deletions
32
SWIG/Lib/csharp/enums.swg
Normal file
32
SWIG/Lib/csharp/enums.swg
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
/* -----------------------------------------------------------------------------
|
||||
* Include this file in order for C/C++ enums to be wrapped by proper C# enums.
|
||||
* Note that the PINVOKE layer handles the enum as an int.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
%typemap(ctype) enum SWIGTYPE "int"
|
||||
%typemap(imtype) enum SWIGTYPE "int"
|
||||
%typemap(cstype) enum SWIGTYPE "$csclassname"
|
||||
|
||||
%typemap(in) enum SWIGTYPE %{ $1 = ($1_ltype)$input; %}
|
||||
%typemap(out) enum SWIGTYPE %{ $result = $1; %}
|
||||
|
||||
%typecheck(SWIG_TYPECHECK_INT32) enum SWIGTYPE ""
|
||||
|
||||
%typemap(throws) enum SWIGTYPE {
|
||||
SWIG_CSharpThrowException(SWIG_CSharpException, "C++ $1_type exception thrown");
|
||||
}
|
||||
|
||||
%typemap(csin) enum SWIGTYPE "(int)$csinput"
|
||||
%typemap(csout) enum SWIGTYPE {
|
||||
return ($csclassname)$imcall;
|
||||
}
|
||||
|
||||
%typemap(csvarout) enum SWIGTYPE %{
|
||||
get {
|
||||
return ($csclassname)$imcall;
|
||||
} %}
|
||||
|
||||
%typemap(csclassmodifiers) enum SWIGTYPE "public enum"
|
||||
|
||||
%csenum(proper);
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue