Parsing stops if an error is encountered or all arguments / format specifiers are exhausted. The number of arguments parsed so far is stored here along with error flags.
Format string describing arguments. A leading '-' in the format string disposes of the arguments on a successful parse. A '|' in the format string signifies that the following arguments are optional. The following format specifiers are recognized:
Table C-2. Format specifiers for sipParseArgs()
fmt Operand type expected C argument(s) s String or None char ** S Slot name, return the name char ** G Signal name, return the name char ** I Class instance int (*convfunc)(PyObject *), PyObject ** O Python object of any type PyObject ** T Python object of given type PyTypeObject *, PyObject ** R Sub-class of QObject PyObject ** F Python callable object PyObject ** a Byte array or None char **, int * c Character char * i Integer int * h Short integer short * l Long integer long * f Float float * d Double float double * v Void pointer void **
Example C-1. Interface for QRegExp::match
// Attempts to match in str, starting from position index. // Returns the position of the match, or -1 if there was no match. // if len is not a null pointer, the length of the match is stored in *len. int match(const char* str, int index=0, int*=0) const; %MemberCode // The Python interface returns the position and length as a tuple. const char *str; int index = 0; if (sipParseArgs(&sipArgsParsed, sipArgs, "s|i", &str, &index)) { int pos, len; QRegExp *ptr; if ((ptr = (QRegExp*) sipGetCppPtr(sipThis, sipClass_QRegExp)) == NULL) return NULL; pos = ptr -> QRegExp::match(str, index, &len); return Py_BuildValue("(ii)", pos, len); } %End