From 31bd3b1550650c69eceea5a8ee238309aea12c5e Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Sun, 13 Apr 2008 02:15:56 +0000 Subject: [PATCH] Expose torrent_handle::is_finished() --- bindings/python/src/torrent_handle.cpp | 1 + include/libtorrent/torrent_handle.hpp | 1 + src/torrent_handle.cpp | 6 ++++++ 3 files changed, 8 insertions(+) diff --git a/bindings/python/src/torrent_handle.cpp b/bindings/python/src/torrent_handle.cpp index 5cb98c062..8d14f1e1e 100755 --- a/bindings/python/src/torrent_handle.cpp +++ b/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/include/libtorrent/torrent_handle.hpp b/include/libtorrent/torrent_handle.hpp index e60b855e1..17484208e 100755 --- a/include/libtorrent/torrent_handle.hpp +++ b/include/libtorrent/torrent_handle.hpp @@ -310,6 +310,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/src/torrent_handle.cpp b/src/torrent_handle.cpp index 1d963060c..de27b78b7 100755 --- a/src/torrent_handle.cpp +++ b/src/torrent_handle.cpp @@ -235,6 +235,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;