From a080fdc8fa07e1cc1602ea382bb93ac5c1cd1fc0 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Sun, 1 Mar 2009 08:13:26 +0000 Subject: [PATCH] python binding fix for file_storage --- bindings/python/src/create_torrent.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/bindings/python/src/create_torrent.cpp b/bindings/python/src/create_torrent.cpp index 86b4fe27f..036d99963 100644 --- a/bindings/python/src/create_torrent.cpp +++ b/bindings/python/src/create_torrent.cpp @@ -13,12 +13,17 @@ using namespace libtorrent; void bind_create_torrent() { void (file_storage::*add_file0)(file_entry const&) = &file_storage::add_file; - void (file_storage::*add_file1)(fs::path const&, size_type) = &file_storage::add_file; + void (file_storage::*add_file1)(fs::path const&, size_type, int) = &file_storage::add_file; + void (file_storage::*add_file2)(fs::wpath const&, size_type, int) = &file_storage::add_file; + + void (file_storage::*set_name0)(std::string const&) = &file_storage::set_name; + void (file_storage::*set_name1)(std::wstring const&) = &file_storage::set_name; class_("file_storage") .def("is_valid", &file_storage::is_valid) .def("add_file", add_file0) - .def("add_file", add_file1) + .def("add_file", add_file1, (arg("path"), arg("size"), arg("flags") = 0)) + .def("add_file", add_file2, (arg("path"), arg("size"), arg("flags") = 0)) .def("num_files", &file_storage::num_files) .def("at", &file_storage::at, return_internal_reference<>()) .def("total_size", &file_storage::total_size) @@ -27,7 +32,8 @@ void bind_create_torrent() .def("set_piece_length", &file_storage::set_piece_length) .def("piece_length", &file_storage::piece_length) .def("piece_size", &file_storage::piece_size) - .def("set_name", &file_storage::set_name) + .def("set_name", set_name0) + .def("set_name", set_name1) .def("name", &file_storage::name, return_internal_reference<>()) ;