[C++-sig] path and tuple translators

Jim Bosch talljimbo at gmail.com
Wed Jan 18 16:59:57 CET 2012


On 01/18/2012 05:59 AM, Johan Råde wrote:
> Does Boost.Python have translators for boost::filesystem::path and
> boost::tuple?
> If not, are there any plans to add this functionality?
>

There are none in Boost.Python proper currently.

You can find converters for Boost.Fusion in the python_extensions 
package in the Boost sandbox; along with Fusion's adapters for 
boost::tuple (see the Fusion docs), that should give you what you need:

https://svn.boost.org/svn/boost/sandbox/python_extensions/

You can probably just pull out the header files you want 
(to_python/boost_fusion.hpp and from_python/boost_fusion.hpp) rather 
than use the whole extensions package.  The std_pair.hpp converters in 
python_extensions may also be helpful as examples, as they use the 
Fusion converters with Fusion's adapters for std::pair.

I also have converters for filesystem::path (just maps to a Python str), 
attached - they should probably go in python_extensions, too, but I've 
gotten lazy about keeping that current.

Jim
-------------- next part --------------
A non-text attachment was scrubbed...
Name: filesystem.hpp
Type: text/x-c++hdr
Size: 2419 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20120118/63894b06/attachment.hpp>


More information about the Cplusplus-sig mailing list