mirror of
https://github.com/monero-project/monero.git
synced 2025-08-22 02:39:35 -04:00
download: async API
This commit is contained in:
parent
9bf017edf2
commit
63f0e074eb
2 changed files with 153 additions and 26 deletions
|
@ -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_thread_control> download_async_handle;
|
||||
|
||||
bool download(const std::string &path, const std::string &url, std::function<bool(const std::string&, const std::string&, size_t, ssize_t)> progress = NULL);
|
||||
download_async_handle download_async(const std::string &path, const std::string &url, std::function<void(const std::string&, const std::string&, bool)> result, std::function<bool(const std::string&, const std::string&, size_t, ssize_t)> 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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue