added get_storage_impl() to torrent_handle
This commit is contained in:
@@ -1589,6 +1589,7 @@ Its declaration looks like this::
|
|||||||
|
|
||||||
boost::filesystem::path save_path() const;
|
boost::filesystem::path save_path() const;
|
||||||
void move_storage(boost::filesystem::path const& save_path) const;
|
void move_storage(boost::filesystem::path const& save_path) const;
|
||||||
|
storage_interface* get_storage_impl() const;
|
||||||
|
|
||||||
sha1_hash info_hash() const;
|
sha1_hash info_hash() const;
|
||||||
|
|
||||||
@@ -1715,6 +1716,16 @@ the same drive as the original save path. Since disk IO is performed in a separa
|
|||||||
thread, this operation is also asynchronous. Once the operation completes, the
|
thread, this operation is also asynchronous. Once the operation completes, the
|
||||||
``storage_moved_alert`` is generated, with the new path as the message.
|
``storage_moved_alert`` is generated, with the new path as the message.
|
||||||
|
|
||||||
|
get_storage_impl()
|
||||||
|
------------------
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
storage_interface* get_storage_impl() const;
|
||||||
|
|
||||||
|
Returns the storage implementation for this torrent. This depends on the
|
||||||
|
storage contructor function that was passed to ``session::add_torrent``.
|
||||||
|
|
||||||
force_reannounce()
|
force_reannounce()
|
||||||
------------------
|
------------------
|
||||||
|
|
||||||
|
@@ -259,6 +259,8 @@ namespace libtorrent
|
|||||||
disk_check_aborted = -3
|
disk_check_aborted = -3
|
||||||
};
|
};
|
||||||
|
|
||||||
|
storage_interface* get_storage_impl() { return m_storage.get(); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
fs::path save_path() const;
|
fs::path save_path() const;
|
||||||
|
@@ -170,6 +170,12 @@ namespace libtorrent
|
|||||||
int seed_rank(session_settings const& s) const;
|
int seed_rank(session_settings const& s) const;
|
||||||
|
|
||||||
storage_mode_t storage_mode() const { return m_storage_mode; }
|
storage_mode_t storage_mode() const { return m_storage_mode; }
|
||||||
|
storage_interface* get_storage()
|
||||||
|
{
|
||||||
|
if (!m_owning_storage) return 0;
|
||||||
|
return m_owning_storage->get_storage_impl();
|
||||||
|
}
|
||||||
|
|
||||||
// this will flag the torrent as aborted. The main
|
// this will flag the torrent as aborted. The main
|
||||||
// loop in session_impl will check for this state
|
// loop in session_impl will check for this state
|
||||||
// on all torrents once every second, and take
|
// on all torrents once every second, and take
|
||||||
|
@@ -366,6 +366,8 @@ namespace libtorrent
|
|||||||
bool resolve_countries() const;
|
bool resolve_countries() const;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
storage_interface* get_storage_impl() const;
|
||||||
|
|
||||||
// all these are deprecated, use piece
|
// all these are deprecated, use piece
|
||||||
// priority functions instead
|
// priority functions instead
|
||||||
|
|
||||||
|
@@ -499,6 +499,12 @@ namespace libtorrent
|
|||||||
TORRENT_FORWARD(replace_trackers(urls));
|
TORRENT_FORWARD(replace_trackers(urls));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
storage_interface* torrent_handle::get_storage_impl() const
|
||||||
|
{
|
||||||
|
INVARIANT_CHECK;
|
||||||
|
TORRENT_FORWARD_RETURN(get_storage(), 0);
|
||||||
|
}
|
||||||
|
|
||||||
torrent_info const& torrent_handle::get_torrent_info() const
|
torrent_info const& torrent_handle::get_torrent_info() const
|
||||||
{
|
{
|
||||||
INVARIANT_CHECK;
|
INVARIANT_CHECK;
|
||||||
|
Reference in New Issue
Block a user