[PyKDE] SIP: MappedType for pointers?

Phil Thompson phil at riverbankcomputing.co.uk
Tue Mar 21 23:48:00 GMT 2006


On Tuesday 21 March 2006 6:23 pm, Giovanni Bajo wrote:
> Hello,
>
> I'm writing a SIP wrapper for a serie of overloaded functions like this:
>
> void Foo(char *str);
> void Foo(wchar_t *str);
>
> void Bar(char *str);
> void Bar(wchar_t *str);
>
> [etc.]
>
> Python supports conversion to/from wchar_t buffers using
> PyUnicode_From/AsWideChar, but SIP does not support it. Could this be added
> automatically?

This is similar to the size_t issue.

> This notwithstanding, I couldn't find a way to use %MappedType to solve my
> problem, without having to write many duplicated %MappedCode. Any pointer?

Hopefully Jim's answer helped. You mapped type could also handle char * which 
means you wouldn't need the overloads.

Phil




More information about the PyQt mailing list