From 78d0c0672862ccd1c839dd1b02664b7f4da2d228 Mon Sep 17 00:00:00 2001
From: Arvid Norberg Adds the file specified by path to the file_storage object. In case path
@@ -112,6 +115,10 @@ which p returns true
and for the wpath version: The path that is passed in to the predicate is the full path of the file or
directory. If no predicate is specified, all files are added, and all directories
are traveresed.
template <class Pred>
void add_files(file_storage& fs, boost::filesystem::path const& path, Pred p);
+template <class Pred>
+void add_files(file_storage& fs, boost::filesystem::wpath const& path, Pred p);
void add_files(file_storage& fs, boost::filesystem::path const& path);
+void add_files(file_storage& fs, boost::filesystem::wpath const& path);
bool Pred(boost::filesystem::path const& p);
+
+bool Pred(boost::filesystem::wpath const& p);
+
template <class Fun> void set_piece_hashes(create_torrent& t, boost::filesystem::path const& p, Fun f); +template <class Fun> +void set_piece_hashes(create_torrent& t, boost::filesystem::wpath const& p, Fun f); void set_piece_hashes(create_torrent& t, boost::filesystem::path const& p); +void set_piece_hashes(create_torrent& t, boost::filesystem::wpath const& p);
This function will assume that the files added to the torrent file exists at path @@ -149,7 +159,9 @@ public: void add_file(file_entry const& e); void add_file(fs::path const& p, size_type size); + void add_file(fs::wpath const& p, size_type size); void rename_file(int index, std::string const& new_filename); + void rename_file(int index, std::wstring const& new_filename); std::vector<file_slice> map_block(int piece, size_type offset , int size) const; @@ -174,6 +186,7 @@ public: int piece_size(int index) const; void set_name(std::string const& n); + void set_name(std::wstring const& n); const std::string& name() const; void swap(file_storage& ti); diff --git a/docs/manual.html b/docs/manual.html index c6dc41de0..515c074c2 100644 --- a/docs/manual.html +++ b/docs/manual.html @@ -191,68 +191,69 @@
The constructor that takes an info-hash will initialize the info-hash to the given value, @@ -1807,7 +1810,9 @@ struct torrent_handle boost::filesystem::path save_path() const; void move_storage(boost::filesystem::path const& save_path) const; + void move_storage(boost::filesystem::wpath const& save_path) const; void rename_file(int index, boost::filesystem::path) const; + void rename_file(int index, boost::filesystem::wpath) const; storage_interface* get_storage_impl() const; sha1_hash info_hash() const; @@ -1919,6 +1924,7 @@ was started.
void move_storage(boost::filesystem::path const& save_path) const; +void move_storage(boost::filesystem::wpath const& save_path) const;
Moves the file(s) that this torrent are currently seeding from or downloading to. If @@ -1935,6 +1941,7 @@ path as the message.
void rename_file(int index, boost::filesystem::path) const; +void rename_file(int index, boost::filesystem::wpath) const;
Renames the file with the given index asynchronously. The rename operation is complete @@ -4331,6 +4338,20 @@ struct performance_alert: torrent_alert };
Generated whenever a torrent changes its state.
++struct state_changed_alert: torrent_alert +{ + // ... + + torrent_status::state_t state; + torrent_status::state_t prev_state; +}; ++
state is the new state of the torrent. prev_state is the previous state.
+This alert is generated when the metadata has been completely received and the info-hash diff --git a/docs/python_binding.html b/docs/python_binding.html index 7a0a9205c..09b5a7d72 100644 --- a/docs/python_binding.html +++ b/docs/python_binding.html @@ -56,8 +56,12 @@ which is a python module that can be imported in a python program.
To set up the Python bindings for libtorrent, you must first have libtorrent -built and installed on the system. See 'building libtorrent'_.
+There is a setup.py shipped with libtorrent that can be used on windows. +On windows the setup.py will invoke bjam and assume that you have boost +sources at $BOOST_PATH. The resulting executable is self-contained, it does +not depend any boost or libtorrent dlls.
+On other systems, the setup.py is generated by running +./configure --enable-python-binding.
To build the Python bindings do:
Run:
@@ -71,9 +75,6 @@ python setup.py installThis requires that you have built and install libtorrent first. The setup.py relies -on pkg-config to be installed as well. It invokes pkg-config in order to link -against libtorrent.