Skip to content

Commit de75091

Browse files
wsfultonsethrj
authored andcommitted
Update documentation
1 parent 04c4869 commit de75091

File tree

1 file changed

+30
-4
lines changed

1 file changed

+30
-4
lines changed

Doc/Manual/Typemaps.html

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2455,13 +2455,39 @@ <H4><a name="Typemaps_special_macro_typemap">14.4.4.2 $typemap(method, typepatte
24552455
</pre>
24562456
</div>
24572457

2458+
<H4><a name="Typemaps_special_macro_typemap_attribute">14.4.4.3 $typemap(method:attribute, typepattern)</a></H4>
2459+
2460+
<p>
2461+
An enhanced version of <tt>$typemap</tt> provides access to typemap attributes by
2462+
appending a colon and the attribute name after the attribute name. In the example below,
2463+
"cstype" is the typemap method and "out" is the typemap attribute.
2464+
<p>
2465+
2466+
<div class="code">
2467+
<pre>
2468+
%typemap(cstype, out="object") XClass "XClass"
2469+
%typemap(cscode) BarClass %{
2470+
$typemap(cstype:out, XClass) bar()
2471+
{
2472+
return null;
2473+
}
2474+
</pre>
2475+
</div>
24582476
<p>
2459-
The first argument, the typemap method, can look up the attribute of a
2460-
typemap by appending a colon and the keyword. For example,
2461-
<tt>$typemap(directorin:descriptor, $type)</tt> would be replaced by <tt>"D"</tt> if <tt>type</tt> is a <tt>double</tt>.
2477+
which expands to
24622478
</p>
2479+
<div class="code">
2480+
<pre>
2481+
object bar()
2482+
{
2483+
return null;
2484+
}
2485+
</pre>
2486+
</div>
2487+
24632488
<p>
2464-
<em>New in SWIG 4.1.</em>
2489+
<b>Compatibility note: </b> Support for typemap attributes in <tt>$typemap</tt>
2490+
was introduced in SWIG-4.1.0.
24652491
</p>
24662492

24672493
<H3><a name="Typemaps_special_variable_attributes">14.4.5 Special variables and typemap attributes</a></H3>

0 commit comments

Comments
 (0)