From 4ffe14573f3db12be02764bf9caa8e4d1a227f70 Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Sun, 13 Apr 2008 03:15:46 +0000 Subject: [PATCH] Expose torrent_handle::is_finished() --- libtorrent/bindings/python/src/torrent_handle.cpp | 1 + libtorrent/include/libtorrent/torrent_handle.hpp | 1 + libtorrent/src/torrent_handle.cpp | 6 ++++++ 3 files changed, 8 insertions(+) diff --git a/libtorrent/bindings/python/src/torrent_handle.cpp b/libtorrent/bindings/python/src/torrent_handle.cpp index 165bea304..1d86145fb 100755 --- a/libtorrent/bindings/python/src/torrent_handle.cpp +++ b/libtorrent/bindings/python/src/torrent_handle.cpp @@ -263,6 +263,7 @@ void bind_torrent_handle() .def("get_torrent_info", _(&torrent_handle::get_torrent_info), return_internal_reference<>()) .def("is_valid", _(&torrent_handle::is_valid)) .def("is_seed", _(&torrent_handle::is_seed)) + .def("is_finished", _(&torrent_handle::is_finished)) .def("is_paused", _(&torrent_handle::is_paused)) .def("pause", _(&torrent_handle::pause)) .def("resume", _(&torrent_handle::resume)) diff --git a/libtorrent/include/libtorrent/torrent_handle.hpp b/libtorrent/include/libtorrent/torrent_handle.hpp index 256209d49..24afbe165 100755 --- a/libtorrent/include/libtorrent/torrent_handle.hpp +++ b/libtorrent/include/libtorrent/torrent_handle.hpp @@ -306,6 +306,7 @@ namespace libtorrent bool is_valid() const; bool is_seed() const; + bool is_finished() const; bool is_paused() const; void pause() const; void resume() const; diff --git a/libtorrent/src/torrent_handle.cpp b/libtorrent/src/torrent_handle.cpp index fbfebbf62..eae0f1729 100755 --- a/libtorrent/src/torrent_handle.cpp +++ b/libtorrent/src/torrent_handle.cpp @@ -261,6 +261,12 @@ namespace libtorrent TORRENT_FORWARD_RETURN(is_seed(), false); } + bool torrent_handle::is_finished() const + { + INVARIANT_CHECK; + TORRENT_FORWARD_RETURN(is_finished(), false); + } + bool torrent_handle::is_paused() const { INVARIANT_CHECK;