summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2009-11-19 12:51:55 -0300
committerMarcelo Lira <marcelo.lira@openbossa.org>2009-11-19 13:07:14 -0300
commit41d487c7dab6dca179cbb90b113e8fe06cd420ce (patch)
tree3e92d486dc763f0d590389c3c7911571a7bb4166 /doc
parent630885e316f17988e9a88cb1cbf8b26c0082f72c (diff)
downloadshiboken-41d487c7dab6dca179cbb90b113e8fe06cd420ce.tar.gz
shiboken-41d487c7dab6dca179cbb90b113e8fe06cd420ce.tar.xz
shiboken-41d487c7dab6dca179cbb90b113e8fe06cd420ce.zip
Added the type system variable "%ARG#_TYPE" which returns the C++ type
for the argument indicated by the numeric index '#'; wrong indexes will issue a generator warning. The documentation was updated as well. Reviewed by Luciano Wolf <luciano.wolf@openbossa.org>
Diffstat (limited to 'doc')
-rw-r--r--doc/typesystemvariables.rst55
1 files changed, 55 insertions, 0 deletions
diff --git a/doc/typesystemvariables.rst b/doc/typesystemvariables.rst
index 26f05477..15fe8732 100644
--- a/doc/typesystemvariables.rst
+++ b/doc/typesystemvariables.rst
@@ -9,14 +9,21 @@ by the correct values. This also shields the developer from some |project|
implementation specifics.
+.. _variables:
+
Variables
=========
+
+.. _return_argument:
+
**%0**
Replaced by the name of the return variable of the Python method/function wrapper.
+.. _arg_number:
+
**%#**
Replaced by the name of a C++ argument in the position indicated by ``#``.
@@ -42,6 +49,8 @@ Variables
value ``123``.
+.. _argument_names:
+
**%ARGUMENT_NAMES**
Replaced by a comma separated list with the names of all C++ arguments that
@@ -78,52 +87,98 @@ Variables
%1, Point(6, 9), %3, Point(3, 4), %5
+.. _arg_type:
+
+**%ARG#_TYPE**
+
+ Replaced by the type of a C++ argument in the position indicated by ``#``.
+ The argument counting starts with ``%1``, since ``%0`` represents the return
+ variable in other contexts, but ``%ARG0_TYPE`` will not translate to the
+ return type, as this is already done by the
+ :ref:`%RETURN_TYPE <return_type>` variable.
+ Example:
+
+ .. code-block:: c++
+
+ void argRemoval(int a0, int a1 = 123);
+
+
+ .. code-block:: xml
+
+ <modify-function signature="argRemoval(int, int)">
+ <modify-argument index="2">
+ <remove-argument/>
+ </modify-argument>
+ </modify-function>
+
+ The ``%1`` will be replaced by the C++ argument name, and ``%2`` will get the
+ value ``123``.
+
+
+.. _converttopython:
+
**%CONVERTTOPYTHON[CPPTYPE]**
Replaced by a |project| conversion call that converts a C++ variable of the
type indicated by ``CPPTYPE`` to the proper Python object.
+.. _cppself:
+
**%CPPSELF**
Replaced by the wrapped C++ object instance that owns the method in which the
code with this variable was inserted.
+.. _function_name:
+
**%FUNCTION_NAME**
Replaced by the name of a function or method.
+.. _pyarg:
+
**%PYARG_#**
Similar to ``%#``, but is replaced by the Python arguments (PyObjects)
received by the Python wrapper method.
+.. _pyself:
+
**%PYSELF**
Replaced by the Python wrapper variable (a PyObject) representing the instance
bounded to the Python wrapper method which receives the custom code.
+.. _pythontypeobject:
+
**%PYTHONTYPEOBJECT**
Replaced by the Python type object for the context in which it is inserted:
method or class modification.
+.. _return_type:
+
**%RETURN_TYPE**
Replaced by the type returned by a function or method.
+.. _type:
+
**%TYPE**
Replaced by the name of the class to which a function belongs. Should be used
in code injected to methods.
+.. _example:
+
Example
=======