From b60132d7da4dbf0c2d06b84b1cfc9586cca3eef6 Mon Sep 17 00:00:00 2001 From: Marcelo Lira Date: Thu, 19 Nov 2009 10:55:04 -0300 Subject: Fixed type system variable replacement for %# and %ARGUMENT_NAMES to handle correctly removed arguments and also consider variable values with default values. The documentation was updated with the new information. --- doc/typesystemvariables.rst | 54 ++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 51 insertions(+), 3 deletions(-) (limited to 'doc') diff --git a/doc/typesystemvariables.rst b/doc/typesystemvariables.rst index 0a3da0bcb..26f05477d 100644 --- a/doc/typesystemvariables.rst +++ b/doc/typesystemvariables.rst @@ -21,13 +21,61 @@ Variables Replaced by the name of a C++ argument in the position indicated by ``#``. The argument counting starts with ``%1``, since ``%0`` represents the return - variable name. + variable name. If the number indicates a variable that was removed in the + type system description, but there is a default value for it, this value will + be used. Consider this example: + + .. code-block:: c++ + + void argRemoval(int a0, int a1 = 123); + + + .. code-block:: xml + + + + + + + + The ``%1`` will be replaced by the C++ argument name, and ``%2`` will get the + value ``123``. **%ARGUMENT_NAMES** - Replaced by a comma separated list with the names of all arguments that were - not removed on the type system description for the method/function. + Replaced by a comma separated list with the names of all C++ arguments that + were not removed on the type system description for the method/function. If + the removed argument has a default value (original or provided in the type + system), this value will be inserted in the argument list. + + Take the following method and related type system description as an example: + + .. code-block:: c++ + + void argRemoval(int a0, Point a1 = Point(1, 2), bool a2 = true, Point a3 = Point(3, 4), int a4 = 56); + + + .. code-block:: xml + + + + + + + + + + + + As seen on the XML description, the function's ``a1`` and ``a3`` arguments + were removed. If any ``inject-code`` for this function uses ``%ARGUMENT_NAMES`` + the resulting list will be the equivalent of using individual argument type + system variables this way: + + .. code-block:: c++ + + %1, Point(6, 9), %3, Point(3, 4), %5 **%CONVERTTOPYTHON[CPPTYPE]** -- cgit v1.2.3