Typemap changes for C# enums.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5852 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
41724c135f
commit
bd7371faa9
1 changed files with 19 additions and 8 deletions
|
|
@ -86,7 +86,7 @@
|
||||||
|
|
||||||
%typemap(ctype) enum SWIGTYPE "int"
|
%typemap(ctype) enum SWIGTYPE "int"
|
||||||
%typemap(imtype) enum SWIGTYPE "int"
|
%typemap(imtype) enum SWIGTYPE "int"
|
||||||
%typemap(cstype) enum SWIGTYPE "int"
|
%typemap(cstype) enum SWIGTYPE "$csclassname"
|
||||||
|
|
||||||
/* pointer to a class member */
|
/* pointer to a class member */
|
||||||
%typemap(ctype) SWIGTYPE (CLASS::*) "int"
|
%typemap(ctype) SWIGTYPE (CLASS::*) "int"
|
||||||
|
|
@ -299,6 +299,10 @@ $1 = &temp; %}
|
||||||
SWIG_CSharpThrowException(SWIG_CSharpException, "C++ $1_type exception thrown");
|
SWIG_CSharpThrowException(SWIG_CSharpException, "C++ $1_type exception thrown");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
%typemap(throws) enum SWIGTYPE {
|
||||||
|
SWIG_CSharpThrowException(SWIG_CSharpException, "C++ $1_type exception thrown");
|
||||||
|
}
|
||||||
|
|
||||||
%typemap(throws) char * {
|
%typemap(throws) char * {
|
||||||
SWIG_CSharpThrowException(SWIG_CSharpException, $1);
|
SWIG_CSharpThrowException(SWIG_CSharpException, $1);
|
||||||
}
|
}
|
||||||
|
|
@ -323,9 +327,9 @@ $1 = &temp; %}
|
||||||
float, const float &,
|
float, const float &,
|
||||||
double, const double &,
|
double, const double &,
|
||||||
char *,
|
char *,
|
||||||
char[ANY],
|
char[ANY]
|
||||||
enum SWIGTYPE
|
|
||||||
"$csinput"
|
"$csinput"
|
||||||
|
%typemap(csin) enum SWIGTYPE "(int)$csinput"
|
||||||
%typemap(csin) SWIGTYPE "$&csclassname.getCPtr($csinput)"
|
%typemap(csin) SWIGTYPE "$&csclassname.getCPtr($csinput)"
|
||||||
%typemap(csin) SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*) "$csclassname.getCPtr($csinput)"
|
%typemap(csin) SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*) "$csclassname.getCPtr($csinput)"
|
||||||
|
|
||||||
|
|
@ -346,10 +350,12 @@ $1 = &temp; %}
|
||||||
float, const float &,
|
float, const float &,
|
||||||
double, const double &,
|
double, const double &,
|
||||||
char *,
|
char *,
|
||||||
char[ANY],
|
char[ANY] {
|
||||||
enum SWIGTYPE {
|
|
||||||
return $imcall;
|
return $imcall;
|
||||||
}
|
}
|
||||||
|
%typemap(csout) enum SWIGTYPE {
|
||||||
|
return ($csclassname)$imcall;
|
||||||
|
}
|
||||||
%typemap(csout) void {
|
%typemap(csout) void {
|
||||||
$imcall;
|
$imcall;
|
||||||
}
|
}
|
||||||
|
|
@ -385,11 +391,15 @@ $1 = &temp; %}
|
||||||
float, const float &,
|
float, const float &,
|
||||||
double, const double &,
|
double, const double &,
|
||||||
char *,
|
char *,
|
||||||
char[ANY],
|
char[ANY] %{
|
||||||
enum SWIGTYPE %{
|
|
||||||
get {
|
get {
|
||||||
return $imcall;
|
return $imcall;
|
||||||
} %}
|
} %}
|
||||||
|
%typemap(csvarout) enum SWIGTYPE %{
|
||||||
|
get {
|
||||||
|
return ($csclassname)$imcall;
|
||||||
|
} %}
|
||||||
|
|
||||||
%typemap(csvarout) void %{
|
%typemap(csvarout) void %{
|
||||||
get {
|
get {
|
||||||
$imcall;
|
$imcall;
|
||||||
|
|
@ -410,7 +420,7 @@ $1 = &temp; %}
|
||||||
|
|
||||||
/* Typemaps used for the generation of proxy and type wrapper class code */
|
/* Typemaps used for the generation of proxy and type wrapper class code */
|
||||||
%typemap(csbase) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*) ""
|
%typemap(csbase) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*) ""
|
||||||
%typemap(csclassmodifiers) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*) "public"
|
%typemap(csclassmodifiers) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*), enum SWIGTYPE "public"
|
||||||
%typemap(cscode) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*) ""
|
%typemap(cscode) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*) ""
|
||||||
%typemap(csimports) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*) "\nusing System;\n"
|
%typemap(csimports) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*) "\nusing System;\n"
|
||||||
%typemap(csinterfaces) SWIGTYPE "IDisposable"
|
%typemap(csinterfaces) SWIGTYPE "IDisposable"
|
||||||
|
|
@ -450,6 +460,7 @@ $1 = &temp; %}
|
||||||
|
|
||||||
/* C# specific directives */
|
/* C# specific directives */
|
||||||
#define %csconst(flag) %feature("cs:const","flag")
|
#define %csconst(flag) %feature("cs:const","flag")
|
||||||
|
#define %csenumint(flag) %feature("cs:enumint","flag")
|
||||||
#define %csmethodmodifiers %feature("cs:methodmodifiers")
|
#define %csmethodmodifiers %feature("cs:methodmodifiers")
|
||||||
|
|
||||||
%pragma(csharp) moduleimports=%{
|
%pragma(csharp) moduleimports=%{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue