<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>API Extractor — 3.3. Modifying Functions</title> <link rel="stylesheet" href="_static/pysidedocs.css" type="text/css" /> <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> <script type="text/javascript"> var DOCUMENTATION_OPTIONS = { URL_ROOT: '#', VERSION: '0.10.0', COLLAPSE_MODINDEX: false, FILE_SUFFIX: '.html', HAS_SOURCE: true }; </script> <script type="text/javascript" src="_static/jquery.js"></script> <script type="text/javascript" src="_static/underscore.js"></script> <script type="text/javascript" src="_static/doctools.js"></script> <!--[if lt IE 7]> <style media="screen" type="text/css"> #container { height:100%; } </style> <![endif]--> <link rel="top" title="API Extractor v0.10.0 documentation" href="index.html" /> <link rel="up" title="3. The API Extractor Type System" href="typesystem.html" /> <link rel="next" title="3.4. Modifying Arguments" href="typesystem_arguments.html" /> <link rel="prev" title="3.2. Manipulating Object and Value Types" href="typesystem_manipulating_objects.html" /> </head> <body id="typesystem_modify_function"> <div id="container"> <div id="header"> <div id="header_container"> <div id="logo"><a href="http://www.pyside.org"><img alt="PySide" src="_static/pysidelogo.png" width="199" height="102" /></a></div> <ul id="relbar"> <li class="right"> <a href="typesystem_arguments.html" title="3.4. Modifying Arguments" accesskey="N">next</a></li> <li class="right"> <a href="typesystem_manipulating_objects.html" title="3.2. Manipulating Object and Value Types" accesskey="P">previous</a> |</li> <li><a href="contents.html">API Extractor v0.10.0 documentation</a> »</li> <li><a href="typesystem.html" accesskey="U">3. The API Extractor Type System</a> »</li> </ul> </div> </div> <div id="body" > <div id="sidebar"> <h3><a href="contents.html">Table Of Contents</a></h3> <ul> <li><a class="reference internal" href="#">3.3. Modifying Functions</a><ul> <li><a class="reference internal" href="#modify-argument">3.3.1. modify-argument</a></li> <li><a class="reference internal" href="#remove">3.3.2. remove</a></li> <li><a class="reference internal" href="#access">3.3.3. access</a></li> <li><a class="reference internal" href="#rename">3.3.4. rename</a></li> </ul> </li> </ul> <h3>Previous topic</h3> <p class="topless"><a href="typesystem_manipulating_objects.html" title="previous chapter">3.2. Manipulating Object and Value Types</a></p> <h3>Next topic</h3> <p class="topless"><a href="typesystem_arguments.html" title="next chapter">3.4. Modifying Arguments</a></p> <div id="search_box"> <h3>Quick search</h3> <form action="search.html" method="get"> <input type="text" name="q" id="q" /> <input type="submit" value="Go" id="search_button" /> <input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="area" value="default" /> </form> </div> </div> <div class="section" id="modifying-functions"> <span id="id1"></span><h1>3.3. Modifying Functions</h1> <div class="section" id="modify-argument"> <span id="id2"></span><h2>3.3.1. modify-argument</h2> <blockquote> <div><p>The modify-argument node specifies which of the given function’s arguments the modification affects, and is a child of the modify-function node. Use the remove-argument, replace-default-expression, remove-default-expression, replace-type, reference-count and define-ownership nodes to specify the details of the modification.</p> <div class="highlight-xml"><div class="highlight"><pre><span class="nt"><modify-function></span> <span class="nt"><modify-argument</span> <span class="na">index=</span><span class="s">"return | this | 1 ..."</span> <span class="nt">></span> // modifications <span class="nt"></modify-argument></span> <span class="nt"></modify-function></span> </pre></div> </div> <p>Set the <tt class="docutils literal"><span class="pre">index</span></tt> attribute to “1” for the first argument, “2” for the second one and so on. Alternatively, set it to “return” or “this” if you want to modify the function’s return value or the object the function is called upon, respectively.</p> </div></blockquote> </div> <div class="section" id="remove"> <span id="id3"></span><h2>3.3.2. remove</h2> <blockquote> <div><p>The remove node removes the given method from the generated target language API, and it is a child of the modify-function node.</p> <div class="highlight-xml"><div class="highlight"><pre><span class="nt"><modify-function></span> <span class="nt"><remove</span> <span class="na">class=</span><span class="s">"all"</span> <span class="nt">/></span> <span class="nt"></modify-function></span> </pre></div> </div> <div class="admonition warning"> <p class="first admonition-title">Warning</p> <p class="last">This tag is deprecated, use the <tt class="docutils literal"><span class="pre">remove</span></tt> attribute from <a class="reference internal" href="typesystem_manipulating_objects.html#modify-function"><em>modify-function</em></a> tag instead.</p> </div> </div></blockquote> </div> <div class="section" id="access"> <span id="id4"></span><h2>3.3.3. access</h2> <blockquote> <div><p>The access node changes the access privileges of the given function in the generated target language API, and it is a child of the modify-function node.</p> <div class="highlight-xml"><div class="highlight"><pre><span class="nt"><modify-function></span> <span class="nt"><access</span> <span class="na">modifier=</span><span class="s">"public | protected | private"</span><span class="nt">/></span> <span class="nt"></modify-function></span> </pre></div> </div> <div class="admonition warning"> <p class="first admonition-title">Warning</p> <p class="last">This tag is deprecated, use the <tt class="docutils literal"><span class="pre">access</span></tt> attribute from <a class="reference internal" href="typesystem_manipulating_objects.html#modify-function"><em>modify-function</em></a> tag instead.</p> </div> </div></blockquote> </div> <div class="section" id="rename"> <span id="id5"></span><h2>3.3.4. rename</h2> <blockquote> <div><p>The rename node changes the name of the given function in the generated target language API, and it is a child of the modify-function node.</p> <div class="highlight-xml"><div class="highlight"><pre><span class="nt"><modify-function></span> <span class="nt"><rename</span> <span class="na">to=</span><span class="s">"..."</span> <span class="nt">/></span> <span class="nt"></modify-function></span> </pre></div> </div> <p>The <tt class="docutils literal"><span class="pre">to</span></tt> attribute is the new name of the function.</p> <div class="admonition warning"> <p class="first admonition-title">Warning</p> <p class="last">This tag is deprecated, use the <tt class="docutils literal"><span class="pre">rename</span></tt> attribute from <a class="reference internal" href="typesystem_manipulating_objects.html#modify-function"><em>modify-function</em></a> tag instead.</p> </div> </div></blockquote> </div> </div> </div> <!-- container --> <div id="footer"> <a href="http://www.indt.org.br"><img src="_static/logo_indt.jpg" alt="Indt" border="0" /></a> <a href="http://www.openbossa.org"><img src="_static/logo_openbossa.png" alt="Openbossa" border="0" /></a> <a href="http://qt.nokia.com/"><img src="_static/logo_qt.png" alt="Qt" border="0" /></a> <a href="http://www.python.org"><img src="_static/logo_python.jpg" alt="Python" border="0" /></a> </div> </div> </body> </html>