aboutsummaryrefslogtreecommitdiffstats
path: root/doc/typesystem_modify_function.rst
blob: 071cea4f5f113330aece19000e078fffef4ea51d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
.. _modifying-functions:

Modifying Functions
-------------------

.. _modify-argument:

modify-argument
^^^^^^^^^^^^^^^

    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.

    .. code-block:: xml

         <modify-function>
             <modify-argument index="return | this | 1 ..." >
                 // modifications
             </modify-argument>
         </modify-function>

    Set the ``index`` 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.

.. _remove:

remove
^^^^^^

    The remove node removes the given method from the generated target language
    API, and it is a child of the modify-function node.

    .. code-block:: xml

         <modify-function>
             <remove class="all" />
         </modify-function>

    .. warning:: This tag is deprecated, use the ``remove`` attribute from :ref:`modify-function` tag instead.

.. _access:

access
^^^^^^

    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.

    .. code-block:: xml

        <modify-function>
            <access modifier="public | protected | private"/>
        </modify-function>

    .. warning:: This tag is deprecated, use the ``access`` attribute from :ref:`modify-function` tag instead.

.. _rename:

rename
^^^^^^

    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.

    .. code-block:: xml

        <modify-function>
            <rename to="..." />
        </modify-function>

    The ``to`` attribute is the new name of the function.

    .. warning:: This tag is deprecated, use the ``rename`` attribute from :ref:`modify-function` tag instead.