From 63f0e074ebcce0dff6f78072ed751aaa1d9b601f Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Sun, 26 Feb 2017 12:00:45 +0000 Subject: download: async API --- src/common/download.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/common/download.h') diff --git a/src/common/download.h b/src/common/download.h index ab7644689..917cb2278 100644 --- a/src/common/download.h +++ b/src/common/download.h @@ -32,5 +32,13 @@ namespace tools { - bool download(const std::string &path, const std::string &url); + struct download_thread_control; + typedef std::shared_ptr download_async_handle; + + bool download(const std::string &path, const std::string &url, std::function progress = NULL); + download_async_handle download_async(const std::string &path, const std::string &url, std::function result, std::function progress = NULL); + bool download_error(const download_async_handle &h); + bool download_finished(const download_async_handle &h); + bool download_wait(const download_async_handle &h); + bool download_cancel(const download_async_handle &h); } -- cgit v1.2.3