added error handling for set_piece_hashes

This commit is contained in:
Arvid Norberg
2009-03-19 17:32:40 +00:00
parent 7e01b9d990
commit cc432a8cd8
3 changed files with 64 additions and 4 deletions

View File

@@ -93,9 +93,19 @@ set_piece_hashes()
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);
template <class Fun>
void set_piece_hashes(create_torrent& t, boost::filesystem::path const& p, Fun f
, error_code& ec);
template <class Fun>
void set_piece_hashes(create_torrent& t, boost::filesystem::wpath const& p, Fun f
, error_code& ec);
void set_piece_hashes(create_torrent& t, boost::filesystem::path const& p);
void set_piece_hashes(create_torrent& t, boost::filesystem::wpath const& p);
void set_piece_hashes(create_torrent& t, boost::filesystem::path const& p
, error_code& ec);
void set_piece_hashes(create_torrent& t, boost::filesystem::wpath const& p
, error_code& ec);
This function will assume that the files added to the torrent file exists at path
``p``, read those files and hash the content and set the hashes in the ``create_torrent``
@@ -104,6 +114,9 @@ must have the following signature::
void Fun(int);
The overloads that don't take an ``error_code&`` may throw an exception in case of a
file error, the other overloads sets the error code to reflect the error, if any.
file_storage
============