Skip to content

Commit

Permalink
Add in all C# command line options to the docs
Browse files Browse the repository at this point in the history
  • Loading branch information
wsfulton committed Jun 11, 2015
1 parent 2b9b007 commit c1a1899
Showing 1 changed file with 49 additions and 17 deletions.
66 changes: 49 additions & 17 deletions Doc/Manual/CSharp.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ <H1><a name="CSharp"></a>20 SWIG and C#</H1>
<li><a href="#CSharp_introduction_swig2_compatibility">SWIG 2 Compatibility</a>
</ul>
<ul>
<li><a href="#CSharp_introduction_command_line_options">C# Command Line Options</a>
<li><a href="#CSharp_commandline">Additional command line options</a>
</ul
<li><a href="#CSharp_differences_java">Differences to the Java module</a>
<li><a href="#CSharp_void_pointers">Void pointers</a>
Expand All @@ -37,7 +37,7 @@ <H1><a name="CSharp"></a>20 SWIG and C#</H1>
<li><a href="#CSharp_directors_implementation">Directors implementation</a>
<li><a href="#CSharp_director_caveats">Director caveats</a>
</ul>
<li><a href="#CSharp_multiple_modules">Multiples modules</a>
<li><a href="#CSharp_multiple_modules">Multiple modules</a>
<li><a href="#CSharp_typemap_examples">C# Typemap examples</a>
<ul>
<li><a href="#CSharp_memory_management_member_variables">Memory management when returning references to member variables</a>
Expand Down Expand Up @@ -82,26 +82,58 @@ <H3><a name="CSharp_introduction_swig2_compatibility"></a>20.1.1 SWIG 2 Compatib
In order to minimize name collisions between names generated based on input to SWIG and names used in the generated code from the .NET framework, SWIG 3 fully qualifies the use of all .NET types. Furthermore, SWIG 3 avoids <tt>using</tt> directives in generated code. This breaks backwards compatibility with typemaps, pragmas, etc written for use with SWIG 2 that assume the presence of <tt>using System;</tt> or <tt>using System.Runtime.InteropServices;</tt> directives in the intermediate class imports, module imports, or proxy imports. SWIG 3 supports backwards compatibility though the use of the <tt>SWIG2_CSHARP</tt> macro. If <tt>SWIG2_CSHARP</tt> is defined, SWIG 3 generates <tt>using</tt> directives in the intermediate class, module class, and proxy class code similar to those generated by SWIG 2. This can be done without modifying any of the input code by passing the <tt>-DSWIG2_CSHARP</tt> commandline parameter when executing <tt>swig</tt>.
</p>

<H3><a name="CSharp_introduction_command_line_options"></a>20.1.2 C# Command Line Options</H3>


<p>Additional command line options that can be used to control code generation:</p>
<H3><a name="CSharp_commandline"></a>20.1.2 Additional command line options</H3>

<p>
<b><tt>-outfile &lt;filename&gt;</tt></b><br>
This command line will instruct the C# module to write all generated C# code to &lt;filename&gt; (located in the output directory) instead of creating separate files for generated classes.<br/>
Caveats:
<ul>
The following table lists the additional commandline options available for the C# module. They can also be seen by using:
</p>

<li>
The file extension (.cs) will not be automatically be added and needs to be provided.
</li>
<div class="code"><pre>
swig -csharp -help
</pre></div>

<li>
Due to possible compiler limits it is not advisable to use <tt>-outfile</tt> when generating wrappers for big projects.
</li>
<p></p>

</ul>
<table summary="C# specific options">
<tr>
<th>C# specific options</th>
</tr>

<tr>
<td>-dllimport &lt;dl&gt;</td>
<td>Override DllImport attribute name to &lt;dl&gt;</td>
</tr>

<tr>
<td>-namespace &lt;nm&gt;</td>
<td>Generate wrappers into C# namespace &lt;nm&gt;</td>
</tr>

<tr>
<td>-noproxy</td>
<td>Generate the low-level functional interface instead of proxy classes</td>
</tr>

<tr>
<td>-oldvarnames</td>
<td>Old intermediary method names for variable wrappers</td>
</tr>

<tr>
<td>-outfile &lt;file&gt;</td>
<td>Write all C# into a single &lt;file&gt; located in the output directory
</td>
</tr>

</table>

<p>
The -outfile option combines all the generated C# code into a single output file instead of creating multiple C# files.
The default, when this option is not provided, is to generate separate .cs files for the module class,
intermediary class and each of the generated proxy and type wrapper classes.
Note that the file extension (.cs) will not be automatically added and needs to be provided.
Due to possible compiler limits it is not advisable to use <tt>-outfile</tt> for large projects.
</p>

<H2><a name="CSharp_differences_java"></a>20.2 Differences to the Java module</H2>
Expand Down Expand Up @@ -1707,7 +1739,7 @@ <H3><a name="CSharp_director_caveats"></a>20.6.3 Director caveats</H3>
should pass the call on to <tt>CSharpDefaults.DefaultMethod(int)</tt>using the C++ default value, as shown above.
</p>

<H2><a name="CSharp_multiple_modules"></a>20.7 Multiples modules</H2>
<H2><a name="CSharp_multiple_modules"></a>20.7 Multiple modules</H2>


<p>
Expand Down

0 comments on commit c1a1899

Please sign in to comment.