diff options
Diffstat (limited to 'tests/samplebinding/typesystem_sample.xml')
-rw-r--r-- | tests/samplebinding/typesystem_sample.xml | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/samplebinding/typesystem_sample.xml b/tests/samplebinding/typesystem_sample.xml index e1837bbd3..eeaf3c218 100644 --- a/tests/samplebinding/typesystem_sample.xml +++ b/tests/samplebinding/typesystem_sample.xml @@ -1203,6 +1203,32 @@ <define-ownership owner="c++"/> </modify-argument> </modify-function> + <modify-function signature="acceptSequence(const char**)"> + <modify-argument index="1"> + <replace-type modified-type="PySequence" /> + <conversion-rule class="native"> + { + Shiboken::AutoDecRef strList(PySequence_Fast(%PYARG_1, "The argument must be a sequence.")); + int lineCount = PySequence_Fast_GET_SIZE(strList.object()); + for (int line = 0; line < lineCount; ++line) { + if (!PyString_Check(PySequence_Fast_GET_ITEM(strList.object(), line))) { + PyErr_SetString(PyExc_TypeError, "The argument must be a sequence of strings."); + break; + } + } + } + const char** %out = 0; + </conversion-rule> + </modify-argument> + </modify-function> + <modify-function signature="acceptSequence(void*)"> + <modify-argument index="1"> + <replace-type modified-type="PyObject" /> + <conversion-rule class="native"> + void* %out = 0; + </conversion-rule> + </modify-argument> + </modify-function> <template name="buffer_argument"> unsigned char* %out; |