aboutsummaryrefslogtreecommitdiff
path: root/Examples/test-suite/autodoc.i
diff options
context:
space:
mode:
Diffstat (limited to 'Examples/test-suite/autodoc.i')
-rw-r--r--Examples/test-suite/autodoc.i44
1 files changed, 43 insertions, 1 deletions
diff --git a/Examples/test-suite/autodoc.i b/Examples/test-suite/autodoc.i
index a2d9f5b4e..9f4365ee1 100644
--- a/Examples/test-suite/autodoc.i
+++ b/Examples/test-suite/autodoc.i
@@ -1,5 +1,7 @@
%module(docstring="hello.") autodoc
+%warnfilter(SWIGWARN_PARSE_KEYWORD) inout;
+
%feature("autodoc");
// special typemap and its docs
@@ -74,6 +76,10 @@
%feature("autodoc","1") D::D(int a, int b, Hola h); // names + types
%feature("autodoc","2") E::E(int a, int b, Hola h); // extended
%feature("autodoc","3") F::F(int a, int b, Hola h); // extended + types
+%feature("autodoc","0") C::~C(); // names
+%feature("autodoc","1") D::~D(); // names + types
+%feature("autodoc","2") E::~E(); // extended
+%feature("autodoc","3") F::~F(); // extended + types
%inline {
@@ -133,6 +139,14 @@ typedef int Integer;
void banana(S *a, const struct tagS *b, int c, Integer d) {}
%}
+// Check docs for a template type
+%inline %{
+template<typename X> struct T {
+ T inout(T t) { return t; }
+};
+%}
+%template(TInteger) T<int>;
+
%inline %{
#ifdef SWIGPYTHON_BUILTIN
bool is_python_builtin() { return true; }
@@ -140,4 +154,32 @@ bool is_python_builtin() { return true; }
bool is_python_builtin() { return false; }
#endif
%}
-
+
+// Autodoc language keywords
+%feature(autodoc,1) process;
+%feature(autodoc,1) process2;
+%feature("compactdefaultargs") process;
+%feature("compactdefaultargs") process2;
+%inline %{
+int process(int from, int in, int var) { return from; }
+int process2(int from = 0, int _in = 1, int var = 2) { return from; }
+%}
+
+%feature(autodoc,1) process3;
+%feature(autodoc,1) process4;
+%feature("kwargs") process3;
+%feature("kwargs") process4;
+%inline %{
+int process3(int from, int _in, int var) { return from; }
+int process4(int from = 0, int _in = 1, int var = 2) { return from; }
+%}
+
+// Autodoc for methods with default arguments not directly representable in
+// target language.
+%feature(autodoc,0) process_complex_defval;
+%feature("compactdefaultargs") process_complex_defval;
+%inline %{
+const int PROCESS_DEFAULT_VALUE = 17;
+typedef long int some_type;
+int process_complex_defval(int val = PROCESS_DEFAULT_VALUE, int factor = some_type(-1)) { return val*factor; }
+%}