summaryrefslogtreecommitdiff
path: root/Doc
diff options
context:
space:
mode:
authorVadim Zeitlin <vz-swig@zeitlins.org>2010-11-16 14:08:50 +0000
committerVadim Zeitlin <vz-swig@zeitlins.org>2010-11-16 14:08:50 +0000
commite30befd13806fb89c1591c56a7a66a5c24d1a14e (patch)
tree232ecac6d9cf89d391213e6b6c6487ebfe19c421 /Doc
parent580f2549582602399553fded9e12bca6f9746143 (diff)
downloadswig-e30befd13806fb89c1591c56a7a66a5c24d1a14e.tar.gz
Correct explanation of how to match on class name in %rename.
Replace incorrect documentation of $parentNode from %rename discussion: it advised using match$parentNode but this doesn't work because the parent node is not yet set when %rename is parsed. Document the "fullname" attribute of %rename which can be used to restrict the match to the given full name of a declaration only. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12291 626c5289-ae23-0410-ae9c-e8d60b6d4f22
Diffstat (limited to 'Doc')
-rw-r--r--Doc/Manual/SWIG.html24
1 files changed, 8 insertions, 16 deletions
diff --git a/Doc/Manual/SWIG.html b/Doc/Manual/SWIG.html
index e51e55986..b8e3e2260 100644
--- a/Doc/Manual/SWIG.html
+++ b/Doc/Manual/SWIG.html
@@ -2003,22 +2003,6 @@ documentation is not exhaustive, see "%rename predicates" section of
</p>
<p>
-Another important feature of <tt>match</tt> is that it can be applied not
-only to the declaration itself but also to its enclosing declaration. So
-<tt>match$parentNode$name="SomeClass"</tt> would be true only for members of
-the C++ class with the specified name. This can, of course, be combined with
-more complicated matches making it possible to write
-</p>
-<div class="code">
-<pre>
-%rename("%(lowercase)s", match$parentNode$name="SomeClass", %$isenum) "";
-</pre>
-</div>
-<p>
-to rename all enums nested in the given class to lower case.
-</p>
-
-<p>
In addition to literally matching some string with <tt>match</tt> you can
also use <tt>regexmatch</tt> or <tt>notregexmatch</tt> to match a string
against a regular expression. For example, to ignore all functions having
@@ -2039,6 +2023,14 @@ declaration name directly can be preferable and can also be done using
%rename("$ignore", regextarget=1) "Old$";
</pre>
</div>
+Notice that the check is done only against the name of the declaration
+itself, if you need to match the full name of a C++ declaration you
+must use <tt>fullname</tt> attribute:
+<div class="code">
+<pre>
+%rename("$ignore", regextarget=1, fullname=1) "NameSpace::ClassName::.*Old$";
+</pre>
+</div>
<p>
As for <tt>notregexmatch</tt>, it restricts the match only to the strings not