Boost logo

Boost Users :

From: David Abrahams (dave_at_[hidden])
Date: 2008-05-12 19:16:31


on Thu May 08 2008, "Dan Fike" <dan.fike-AT-volition-inc.com> wrote:

> [Boost.Python]
>
> Anybody have a suggestion for the best way to expose a class's member
> function that accepts const wchar_t* as an argument, or returns a const
> wchar_t*?
>
> I'm trying to find a way to do it that does not involve writing a thin
> wrapper function around each of my member functions that convert to/from
> std:wstring or something. If it balloons up into 100 functions that interact
> with const wchar_t*, that's a pretty big handful of tiny wrapper functions.
>
> I apologize if this is a dumb question, but I haven't found any useful info.
> It all works implicitly for const char*.
>
> Any ideas?

Dan,

First, see http://www.boost.org/community/groups.html#cplussig

Next, you'll want to write a custom type converter. I'm sorry that it
isn't documented much. You can read
https://realityforge.vrsource.org/view/PyOpenSG/HowBoostPythonWorks#Converting_from_python_to_c_and
which will teach you quite a lot but you might be better off asking on
the mailing list mentioned above if you just want a quick answer.

HTH,

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net