swig/Lib/csharp/enums.swg
William S Fulton 064082e9b5 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/SWIG@5920 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-05-24 20:08:04 +00:00

32 lines
982 B
Text

/* -----------------------------------------------------------------------------
* 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);