Minor corrections
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6500 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
d70f04e660
commit
a33332a193
4 changed files with 103 additions and 72 deletions
|
|
@ -35,7 +35,15 @@ When invoking SWIG use the <tt>-csharp</tt> command line option instead of <tt>-
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li>
|
<li>
|
||||||
The <tt>-package</tt> command line option does not exist. The <tt>-namespace <name></tt> commandline option will generate all code into the namespace specified by <tt><name></tt>.
|
The <tt>-package</tt> command line option does not exist.
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
The <tt>-namespace <name></tt> commandline option will generate all code into the namespace specified by <tt><name></tt>.
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
The <tt>-dllimport <name></tt> commandline option specifies the name of the DLL for the <tt>DllImport</tt> attribute for every PInvoke method. If this commandline option is not given, the <tt>DllImport</tt> DLL name is the same as the module name. This option is useful for when one wants to invoke SWIG multiple times on different modules, yet compile all the resulting code into a single DLL.
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li>
|
<li>
|
||||||
|
|
@ -129,6 +137,14 @@ $jnicall -> $imcall
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<b><tt>$dllimport</tt></b><br>
|
||||||
|
This is a C# only special variable that can be used in typemaps, pragmas, features etc.
|
||||||
|
The special variable will get translated into the value specified by the <tt>-dllimport</tt> commandline option
|
||||||
|
if specified, otherwise it is equivalent to the <b>$module</b> special variable.
|
||||||
|
</p>
|
||||||
|
|
||||||
The intermediary classname has <tt>PINVOKE</tt> appended after the module name instead of <tt>JNI</tt>, for example <tt>modulenamePINVOKE</tt>.
|
The intermediary classname has <tt>PINVOKE</tt> appended after the module name instead of <tt>JNI</tt>, for example <tt>modulenamePINVOKE</tt>.
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|
|
||||||
|
|
@ -142,7 +142,7 @@
|
||||||
<li><a href="SWIG.html#SWIG_nn26">Arrays</a>
|
<li><a href="SWIG.html#SWIG_nn26">Arrays</a>
|
||||||
<li><a href="SWIG.html#SWIG_nn27">Creating read-only variables</a>
|
<li><a href="SWIG.html#SWIG_nn27">Creating read-only variables</a>
|
||||||
<li><a href="SWIG.html#SWIG_nn28">Renaming and ignoring declarations</a>
|
<li><a href="SWIG.html#SWIG_nn28">Renaming and ignoring declarations</a>
|
||||||
<li><a href="SWIG.html#SWIG_nn29">Default/optional arguments</a>
|
<li><a href="SWIG.html#SWIG_default_args">Default/optional arguments</a>
|
||||||
<li><a href="SWIG.html#SWIG_nn30">Pointers to functions and callbacks</a>
|
<li><a href="SWIG.html#SWIG_nn30">Pointers to functions and callbacks</a>
|
||||||
</ul>
|
</ul>
|
||||||
<li><a href="SWIG.html#SWIG_nn31">Structures and unions</a>
|
<li><a href="SWIG.html#SWIG_nn31">Structures and unions</a>
|
||||||
|
|
@ -190,9 +190,9 @@
|
||||||
<li><a href="SWIGPlus.html#SWIGPlus_nn10">Copy constructors</a>
|
<li><a href="SWIGPlus.html#SWIGPlus_nn10">Copy constructors</a>
|
||||||
<li><a href="SWIGPlus.html#SWIGPlus_nn11">Member functions</a>
|
<li><a href="SWIGPlus.html#SWIGPlus_nn11">Member functions</a>
|
||||||
<li><a href="SWIGPlus.html#SWIGPlus_nn12">Static members</a>
|
<li><a href="SWIGPlus.html#SWIGPlus_nn12">Static members</a>
|
||||||
<li><a href="SWIGPlus.html#SWIGPlus_nn13">Member functions and default arguments</a>
|
<li><a href="SWIGPlus.html#SWIGPlus_nn13">Member data</a>
|
||||||
<li><a href="SWIGPlus.html#SWIGPlus_nn14">Member data</a>
|
|
||||||
</ul>
|
</ul>
|
||||||
|
<li><a href="SWIGPlus.html#SWIGPlus_default_args">Default arguments</a>
|
||||||
<li><a href="SWIGPlus.html#SWIGPlus_nn15">Protection</a>
|
<li><a href="SWIGPlus.html#SWIGPlus_nn15">Protection</a>
|
||||||
<li><a href="SWIGPlus.html#SWIGPlus_nn16">Enums and constants</a>
|
<li><a href="SWIGPlus.html#SWIGPlus_nn16">Enums and constants</a>
|
||||||
<li><a href="SWIGPlus.html#SWIGPlus_nn17">Friends</a>
|
<li><a href="SWIGPlus.html#SWIGPlus_nn17">Friends</a>
|
||||||
|
|
@ -201,7 +201,7 @@
|
||||||
<li><a href="SWIGPlus.html#SWIGPlus_nn20">Inheritance</a>
|
<li><a href="SWIGPlus.html#SWIGPlus_nn20">Inheritance</a>
|
||||||
<li><a href="SWIGPlus.html#SWIGPlus_nn21">A brief discussion of multiple inheritance, pointers, and type checking</a>
|
<li><a href="SWIGPlus.html#SWIGPlus_nn21">A brief discussion of multiple inheritance, pointers, and type checking</a>
|
||||||
<li><a href="SWIGPlus.html#SWIGPlus_nn22">Renaming</a>
|
<li><a href="SWIGPlus.html#SWIGPlus_nn22">Renaming</a>
|
||||||
<li><a href="SWIGPlus.html#SWIGPlus_nn23">Wrapping Overloaded Functions and Methods</a>
|
<li><a href="SWIGPlus.html#SWIGPlus_overloaded_methods">Wrapping Overloaded Functions and Methods</a>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="SWIGPlus.html#SWIGPlus_nn24">Dispatch function generation</a>
|
<li><a href="SWIGPlus.html#SWIGPlus_nn24">Dispatch function generation</a>
|
||||||
<li><a href="SWIGPlus.html#SWIGPlus_nn25">Ambiguity in Overloading</a>
|
<li><a href="SWIGPlus.html#SWIGPlus_nn25">Ambiguity in Overloading</a>
|
||||||
|
|
@ -436,10 +436,9 @@
|
||||||
<!-- INDEX -->
|
<!-- INDEX -->
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="Modules.html#Modules_nn2">The SWIG runtime code</a>
|
<li><a href="Modules.html#Modules_nn2">The SWIG runtime code</a>
|
||||||
<li><a href="Modules.html#Modules_nn3">Compiling Multiple SWIG modules</a>
|
<li><a href="Modules.html#Modules_nn3">A word of caution about static libraries</a>
|
||||||
<li><a href="Modules.html#Modules_nn4">A word of caution about static libraries</a>
|
<li><a href="Modules.html#Modules_nn4">References</a>
|
||||||
<li><a href="Modules.html#Modules_nn5">References</a>
|
<li><a href="Modules.html#Modules_nn5">Reducing the wrapper file size</a>
|
||||||
<li><a href="Modules.html#Modules_nn6">Reducing the wrapper file size</a>
|
|
||||||
</ul>
|
</ul>
|
||||||
<!-- INDEX -->
|
<!-- INDEX -->
|
||||||
|
|
||||||
|
|
@ -490,23 +489,22 @@
|
||||||
<li><a href="Guile.html#Guile_nn7">Native Guile Module Linkage</a>
|
<li><a href="Guile.html#Guile_nn7">Native Guile Module Linkage</a>
|
||||||
<li><a href="Guile.html#Guile_nn8">Old Auto-Loading Guile Module Linkage</a>
|
<li><a href="Guile.html#Guile_nn8">Old Auto-Loading Guile Module Linkage</a>
|
||||||
<li><a href="Guile.html#Guile_nn9">Hobbit4D Linkage</a>
|
<li><a href="Guile.html#Guile_nn9">Hobbit4D Linkage</a>
|
||||||
<li><a href="Guile.html#Guile_nn10">General Remarks on Multiple SWIG Modules</a>
|
|
||||||
</ul>
|
</ul>
|
||||||
<li><a href="Guile.html#Guile_nn11">Underscore Folding</a>
|
<li><a href="Guile.html#Guile_nn10">Underscore Folding</a>
|
||||||
<li><a href="Guile.html#Guile_nn12">Typemaps</a>
|
<li><a href="Guile.html#Guile_nn11">Typemaps</a>
|
||||||
<li><a href="Guile.html#Guile_nn13">Representation of pointers as smobs</a>
|
<li><a href="Guile.html#Guile_nn12">Representation of pointers as smobs</a>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="Guile.html#Guile_nn14">GH Smobs</a>
|
<li><a href="Guile.html#Guile_nn13">GH Smobs</a>
|
||||||
<li><a href="Guile.html#Guile_nn15">SCM Smobs</a>
|
<li><a href="Guile.html#Guile_nn14">SCM Smobs</a>
|
||||||
<li><a href="Guile.html#Guile_nn16">Garbage Collection</a>
|
<li><a href="Guile.html#Guile_nn15">Garbage Collection</a>
|
||||||
</ul>
|
</ul>
|
||||||
<li><a href="Guile.html#Guile_nn17">Exception Handling</a>
|
<li><a href="Guile.html#Guile_nn16">Exception Handling</a>
|
||||||
<li><a href="Guile.html#Guile_nn18">Procedure documentation</a>
|
<li><a href="Guile.html#Guile_nn17">Procedure documentation</a>
|
||||||
<li><a href="Guile.html#Guile_nn19">Procedures with setters</a>
|
<li><a href="Guile.html#Guile_nn18">Procedures with setters</a>
|
||||||
<li><a href="Guile.html#Guile_nn20">GOOPS Proxy Classes</a>
|
<li><a href="Guile.html#Guile_nn19">GOOPS Proxy Classes</a>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="Guile.html#Guile_nn21">Naming Issues</a>
|
<li><a href="Guile.html#Guile_nn20">Naming Issues</a>
|
||||||
<li><a href="Guile.html#Guile_nn22">Linking</a>
|
<li><a href="Guile.html#Guile_nn21">Linking</a>
|
||||||
</ul>
|
</ul>
|
||||||
</ul>
|
</ul>
|
||||||
<!-- INDEX -->
|
<!-- INDEX -->
|
||||||
|
|
@ -554,6 +552,7 @@
|
||||||
<li><a href="Java.html#null_pointers">Null pointers</a>
|
<li><a href="Java.html#null_pointers">Null pointers</a>
|
||||||
</ul>
|
</ul>
|
||||||
<li><a href="Java.html#overloaded_functions">C++ overloaded functions</a>
|
<li><a href="Java.html#overloaded_functions">C++ overloaded functions</a>
|
||||||
|
<li><a href="Java.html#java_default_arguments">C++ default arguments</a>
|
||||||
<li><a href="Java.html#namespaces">C++ namespaces</a>
|
<li><a href="Java.html#namespaces">C++ namespaces</a>
|
||||||
<li><a href="Java.html#templates">C++ templates</a>
|
<li><a href="Java.html#templates">C++ templates</a>
|
||||||
<li><a href="Java.html#smart_pointers">C++ Smart Pointers</a>
|
<li><a href="Java.html#smart_pointers">C++ Smart Pointers</a>
|
||||||
|
|
@ -702,32 +701,35 @@
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="Ocaml.html#Ocaml_nn9">The generated module</a>
|
<li><a href="Ocaml.html#Ocaml_nn9">The generated module</a>
|
||||||
<li><a href="Ocaml.html#Ocaml_nn10">Enums</a>
|
<li><a href="Ocaml.html#Ocaml_nn10">Enums</a>
|
||||||
<li><a href="Ocaml.html#Ocaml_nn11">Arrays</a>
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="Ocaml.html#Ocaml_nn12">Simple types of bounded arrays</a>
|
<li><a href="Ocaml.html#Ocaml_nn11">Enum typing in Ocaml</a>
|
||||||
<li><a href="Ocaml.html#Ocaml_nn13">Complex and unbounded arrays</a>
|
|
||||||
<li><a href="Ocaml.html#Ocaml_nn14">Using an object</a>
|
|
||||||
<li><a href="Ocaml.html#Ocaml_nn15">Example typemap for a function taking float * and int</a>
|
|
||||||
</ul>
|
</ul>
|
||||||
<li><a href="Ocaml.html#Ocaml_nn16">C++ Classes</a>
|
<li><a href="Ocaml.html#Ocaml_nn12">Arrays</a>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="Ocaml.html#Ocaml_nn17">STL vector and string Example</a>
|
<li><a href="Ocaml.html#Ocaml_nn13">Simple types of bounded arrays</a>
|
||||||
<li><a href="Ocaml.html#Ocaml_nn18">C++ Class Example</a>
|
<li><a href="Ocaml.html#Ocaml_nn14">Complex and unbounded arrays</a>
|
||||||
<li><a href="Ocaml.html#Ocaml_nn19">Compiling the example</a>
|
<li><a href="Ocaml.html#Ocaml_nn15">Using an object</a>
|
||||||
<li><a href="Ocaml.html#Ocaml_nn20">Sample Session</a>
|
<li><a href="Ocaml.html#Ocaml_nn16">Example typemap for a function taking float * and int</a>
|
||||||
</ul>
|
</ul>
|
||||||
<li><a href="Ocaml.html#Ocaml_nn21">Director Classes</a>
|
<li><a href="Ocaml.html#Ocaml_nn17">C++ Classes</a>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="Ocaml.html#Ocaml_nn22">Director Introduction</a>
|
<li><a href="Ocaml.html#Ocaml_nn18">STL vector and string Example</a>
|
||||||
<li><a href="Ocaml.html#Ocaml_nn23">Overriding Methods in Ocaml</a>
|
<li><a href="Ocaml.html#Ocaml_nn19">C++ Class Example</a>
|
||||||
<li><a href="Ocaml.html#Ocaml_nn24">Director Usage Example</a>
|
<li><a href="Ocaml.html#Ocaml_nn20">Compiling the example</a>
|
||||||
<li><a href="Ocaml.html#Ocaml_nn25">Creating director objects</a>
|
<li><a href="Ocaml.html#Ocaml_nn21">Sample Session</a>
|
||||||
<li><a href="Ocaml.html#Ocaml_nn26">Typemaps for directors, <tt>directorin, directorout, directorargout</tt></a>
|
|
||||||
<li><a href="Ocaml.html#Ocaml_nn27"><tt>directorin</tt> typemap</a>
|
|
||||||
<li><a href="Ocaml.html#Ocaml_nn28"><tt>directorout</tt> typemap</a>
|
|
||||||
<li><a href="Ocaml.html#Ocaml_nn29"><tt>directorargout</tt> typemap</a>
|
|
||||||
</ul>
|
</ul>
|
||||||
<li><a href="Ocaml.html#Ocaml_nn30">Exceptions</a>
|
<li><a href="Ocaml.html#Ocaml_nn22">Director Classes</a>
|
||||||
|
<ul>
|
||||||
|
<li><a href="Ocaml.html#Ocaml_nn23">Director Introduction</a>
|
||||||
|
<li><a href="Ocaml.html#Ocaml_nn24">Overriding Methods in Ocaml</a>
|
||||||
|
<li><a href="Ocaml.html#Ocaml_nn25">Director Usage Example</a>
|
||||||
|
<li><a href="Ocaml.html#Ocaml_nn26">Creating director objects</a>
|
||||||
|
<li><a href="Ocaml.html#Ocaml_nn27">Typemaps for directors, <tt>directorin, directorout, directorargout</tt></a>
|
||||||
|
<li><a href="Ocaml.html#Ocaml_nn28"><tt>directorin</tt> typemap</a>
|
||||||
|
<li><a href="Ocaml.html#Ocaml_nn29"><tt>directorout</tt> typemap</a>
|
||||||
|
<li><a href="Ocaml.html#Ocaml_nn30"><tt>directorargout</tt> typemap</a>
|
||||||
|
</ul>
|
||||||
|
<li><a href="Ocaml.html#Ocaml_nn31">Exceptions</a>
|
||||||
</ul>
|
</ul>
|
||||||
</ul>
|
</ul>
|
||||||
<!-- INDEX -->
|
<!-- INDEX -->
|
||||||
|
|
@ -925,6 +927,18 @@
|
||||||
<li><a href="Python.html#Python_nn63">Mapping sequences to C arrays</a>
|
<li><a href="Python.html#Python_nn63">Mapping sequences to C arrays</a>
|
||||||
<li><a href="Python.html#Python_nn64">Pointer handling</a>
|
<li><a href="Python.html#Python_nn64">Pointer handling</a>
|
||||||
</ul>
|
</ul>
|
||||||
|
<li><a href="Python.html#Python_nn65">Docstring Features</a>
|
||||||
|
<ul>
|
||||||
|
<li><a href="Python.html#Python_nn66">Module docstring</a>
|
||||||
|
<li><a href="Python.html#Python_nn67">%feature("autodoc")</a>
|
||||||
|
<ul>
|
||||||
|
<li><a href="Python.html#Python_nn68">%feature("autodoc", "0")</a>
|
||||||
|
<li><a href="Python.html#Python_nn69">%feature("autodoc", "1")</a>
|
||||||
|
<li><a href="Python.html#Python_nn70">%feature("autodoc", "docstring")</a>
|
||||||
|
</ul>
|
||||||
|
<li><a href="Python.html#Python_nn71">%feature("docstring")</a>
|
||||||
|
</ul>
|
||||||
|
<li><a href="Python.html#Python_nn72">Python Packages</a>
|
||||||
</ul>
|
</ul>
|
||||||
<!-- INDEX -->
|
<!-- INDEX -->
|
||||||
|
|
||||||
|
|
@ -1128,28 +1142,6 @@
|
||||||
</ul>
|
</ul>
|
||||||
<!-- INDEX -->
|
<!-- INDEX -->
|
||||||
|
|
||||||
<h3><a href="Advanced.html#Advanced">30 Advanced Topics</a></h3>
|
|
||||||
|
|
||||||
<!-- INDEX -->
|
|
||||||
<ul>
|
|
||||||
<li><a href="Advanced.html#Advanced_nn2">Creating multi-module packages</a>
|
|
||||||
<ul>
|
|
||||||
<li><a href="Advanced.html#Advanced_nn3">Runtime support (and potential problems)</a>
|
|
||||||
<li><a href="Advanced.html#Advanced_nn4">Why doesn't C++ inheritance work between modules?</a>
|
|
||||||
<li><a href="Advanced.html#Advanced_nn5">The SWIG runtime library</a>
|
|
||||||
<li><a href="Advanced.html#Advanced_nn6">A few dynamic loading gotchas</a>
|
|
||||||
</ul>
|
|
||||||
<li><a href="Advanced.html#Advanced_nn7">Dynamic Loading of C++ modules</a>
|
|
||||||
<li><a href="Advanced.html#Advanced_nn8">Inside the SWIG type-checker</a>
|
|
||||||
<ul>
|
|
||||||
<li><a href="Advanced.html#Advanced_nn9">Type equivalence</a>
|
|
||||||
<li><a href="Advanced.html#Advanced_nn10">Type casting</a>
|
|
||||||
<li><a href="Advanced.html#Advanced_nn11">Why a name based approach?</a>
|
|
||||||
<li><a href="Advanced.html#Advanced_nn12">Performance of the type-checker</a>
|
|
||||||
</ul>
|
|
||||||
</ul>
|
|
||||||
<!-- INDEX -->
|
|
||||||
|
|
||||||
|
|
||||||
</BODY>
|
</BODY>
|
||||||
</HTML>
|
</HTML>
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,9 @@
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="#Ocaml_nn9">The generated module</a>
|
<li><a href="#Ocaml_nn9">The generated module</a>
|
||||||
<li><a href="#Ocaml_nn10">Enums</a>
|
<li><a href="#Ocaml_nn10">Enums</a>
|
||||||
|
<ul>
|
||||||
<li><a href="#Ocaml_nn11">Enum typing in Ocaml</a>
|
<li><a href="#Ocaml_nn11">Enum typing in Ocaml</a>
|
||||||
|
</ul>
|
||||||
<li><a href="#Ocaml_nn12">Arrays</a>
|
<li><a href="#Ocaml_nn12">Arrays</a>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="#Ocaml_nn13">Simple types of bounded arrays</a>
|
<li><a href="#Ocaml_nn13">Simple types of bounded arrays</a>
|
||||||
|
|
@ -442,6 +444,7 @@ val x : Enum_test.c_obj = C_enum `a
|
||||||
|
|
||||||
<H4><a name="Ocaml_nn11"></a>22.2.2.1 Enum typing in Ocaml</H4>
|
<H4><a name="Ocaml_nn11"></a>22.2.2.1 Enum typing in Ocaml</H4>
|
||||||
|
|
||||||
|
|
||||||
The ocaml SWIG module now has support for loading and using multiple SWIG
|
The ocaml SWIG module now has support for loading and using multiple SWIG
|
||||||
modules at the same time. This enhances modularity, but presents problems
|
modules at the same time. This enhances modularity, but presents problems
|
||||||
when used with a language which assumes that each module's types are complete
|
when used with a language which assumes that each module's types are complete
|
||||||
|
|
|
||||||
|
|
@ -87,6 +87,18 @@
|
||||||
<li><a href="#Python_nn63">Mapping sequences to C arrays</a>
|
<li><a href="#Python_nn63">Mapping sequences to C arrays</a>
|
||||||
<li><a href="#Python_nn64">Pointer handling</a>
|
<li><a href="#Python_nn64">Pointer handling</a>
|
||||||
</ul>
|
</ul>
|
||||||
|
<li><a href="#Python_nn65">Docstring Features</a>
|
||||||
|
<ul>
|
||||||
|
<li><a href="#Python_nn66">Module docstring</a>
|
||||||
|
<li><a href="#Python_nn67">%feature("autodoc")</a>
|
||||||
|
<ul>
|
||||||
|
<li><a href="#Python_nn68">%feature("autodoc", "0")</a>
|
||||||
|
<li><a href="#Python_nn69">%feature("autodoc", "1")</a>
|
||||||
|
<li><a href="#Python_nn70">%feature("autodoc", "docstring")</a>
|
||||||
|
</ul>
|
||||||
|
<li><a href="#Python_nn71">%feature("docstring")</a>
|
||||||
|
</ul>
|
||||||
|
<li><a href="#Python_nn72">Python Packages</a>
|
||||||
</ul>
|
</ul>
|
||||||
<!-- INDEX -->
|
<!-- INDEX -->
|
||||||
|
|
||||||
|
|
@ -3857,6 +3869,7 @@ class object (if applicable).
|
||||||
|
|
||||||
<H2><a name="Python_nn65"></a>26.10 Docstring Features</H2>
|
<H2><a name="Python_nn65"></a>26.10 Docstring Features</H2>
|
||||||
|
|
||||||
|
|
||||||
Usign docstrings in Python code is becoming more and more important
|
Usign docstrings in Python code is becoming more and more important
|
||||||
ans more tools are coming on the scene that take advantage of them,
|
ans more tools are coming on the scene that take advantage of them,
|
||||||
everything from full-blown documentaiton generators to class browsers
|
everything from full-blown documentaiton generators to class browsers
|
||||||
|
|
@ -3880,6 +3893,7 @@ of your users much simpler.
|
||||||
|
|
||||||
<H3><a name="Python_nn66"></a>26.10.1 Module docstring</H3>
|
<H3><a name="Python_nn66"></a>26.10.1 Module docstring</H3>
|
||||||
|
|
||||||
|
|
||||||
Python allows a docstring at the begining of the <tt>.py</tt> file
|
Python allows a docstring at the begining of the <tt>.py</tt> file
|
||||||
before any other statements, and it is typically used to give a
|
before any other statements, and it is typically used to give a
|
||||||
general description of the entire module. SWIG supports this by
|
general description of the entire module. SWIG supports this by
|
||||||
|
|
@ -3909,6 +3923,7 @@ layout of controls on a panel, etc. to be loaded from an XML file."
|
||||||
|
|
||||||
<H3><a name="Python_nn67"></a>26.10.2 %feature("autodoc")</H3>
|
<H3><a name="Python_nn67"></a>26.10.2 %feature("autodoc")</H3>
|
||||||
|
|
||||||
|
|
||||||
As alluded to above SWIG will generate all the function and method
|
As alluded to above SWIG will generate all the function and method
|
||||||
proxy wrappers with just "*args" (or "*args, **kwargs" if the -keyword
|
proxy wrappers with just "*args" (or "*args, **kwargs" if the -keyword
|
||||||
option is used) for a parameter list and will then sort out the
|
option is used) for a parameter list and will then sort out the
|
||||||
|
|
@ -3931,7 +3946,8 @@ names, default values if any, and return type if any. There are also
|
||||||
three options for autodoc controlled by the value given to the
|
three options for autodoc controlled by the value given to the
|
||||||
feature, described below.
|
feature, described below.
|
||||||
|
|
||||||
<H4>%feature("autodoc", "0")</H4>
|
<H4><a name="Python_nn68"></a>26.10.2.1 %feature("autodoc", "0")</H4>
|
||||||
|
|
||||||
|
|
||||||
When the "0" option is given then the types of the parameters will
|
When the "0" option is given then the types of the parameters will
|
||||||
<em>not</em> be included in the autodoc string. For example, given
|
<em>not</em> be included in the autodoc string. For example, given
|
||||||
|
|
@ -3949,13 +3965,14 @@ Then Python code like this will be generated:
|
||||||
<blockquote>
|
<blockquote>
|
||||||
<pre>
|
<pre>
|
||||||
def function_name(*args, **kwargs):
|
def function_name(*args, **kwargs):
|
||||||
"""function_name(x, y, foo=None, bar=None) -> bool"""
|
"""function_name(x, y, foo=None, bar=None) -> bool"""
|
||||||
...
|
...
|
||||||
</pre>
|
</pre>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
|
|
||||||
|
|
||||||
<H4>%feature("autodoc", "1")</H4>
|
<H4><a name="Python_nn69"></a>26.10.2.2 %feature("autodoc", "1")</H4>
|
||||||
|
|
||||||
|
|
||||||
When the "1" option is used then the parameter types <em>will</em> be
|
When the "1" option is used then the parameter types <em>will</em> be
|
||||||
used in the autodoc string. In addition, an atempt is made to
|
used in the autodoc string. In addition, an atempt is made to
|
||||||
|
|
@ -3970,14 +3987,15 @@ this:
|
||||||
<blockquote>
|
<blockquote>
|
||||||
<pre>
|
<pre>
|
||||||
def function_name(*args, **kwargs):
|
def function_name(*args, **kwargs):
|
||||||
"""function_name(int x, int y, Foo foo=None, Bar bar=None) -> bool"""
|
"""function_name(int x, int y, Foo foo=None, Bar bar=None) -> bool"""
|
||||||
...
|
...
|
||||||
</pre>
|
</pre>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<H4>%feature("autodoc", "docstring")</H4>
|
<H4><a name="Python_nn70"></a>26.10.2.3 %feature("autodoc", "docstring")</H4>
|
||||||
|
|
||||||
|
|
||||||
Finally, there are times when the automatically generated autodoc
|
Finally, there are times when the automatically generated autodoc
|
||||||
string will make no sense for a Python programmer, particularly when a
|
string will make no sense for a Python programmer, particularly when a
|
||||||
|
|
@ -3987,13 +4005,14 @@ generated string. For example:
|
||||||
|
|
||||||
<blockquote>
|
<blockquote>
|
||||||
<pre>
|
<pre>
|
||||||
%feature("autodoc", "GetPosition() -> (x, y)") GetPosition;
|
%feature("autodoc", "GetPosition() -> (x, y)") GetPosition;
|
||||||
void GetPosition(int* OUTPUT, int* OUTPUT);
|
void GetPosition(int* OUTPUT, int* OUTPUT);
|
||||||
</pre>
|
</pre>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
|
|
||||||
|
|
||||||
<H3><a name="Python_nn68"></a>26.10.3 %feature("docstring")</H3>
|
<H3><a name="Python_nn71"></a>26.10.3 %feature("docstring")</H3>
|
||||||
|
|
||||||
|
|
||||||
In addition to the autodoc strings described above, you can also
|
In addition to the autodoc strings described above, you can also
|
||||||
attach any arbitrary descriptive text to a node in the parse tree with
|
attach any arbitrary descriptive text to a node in the parse tree with
|
||||||
|
|
@ -4020,7 +4039,8 @@ with more than one line.
|
||||||
</pre>
|
</pre>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
|
|
||||||
<H2><a name="Python_nn70"></a>26.11 Python Packages</H2>
|
<H2><a name="Python_nn72"></a>26.11 Python Packages</H2>
|
||||||
|
|
||||||
|
|
||||||
Using the <tt>package</tt> option of the <tt>%module</tt> directive
|
Using the <tt>package</tt> option of the <tt>%module</tt> directive
|
||||||
allows you to specify what Python package that the module will be
|
allows you to specify what Python package that the module will be
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue