From 4ab62150464a5adb9432e444228016e1b8f320af Mon Sep 17 00:00:00 2001 From: Veloman Yunkan Date: Tue, 27 Feb 2024 19:09:27 +0400 Subject: [PATCH] Downloader::Options typedef --- include/downloader.h | 9 ++++++--- src/downloader.cpp | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/include/downloader.h b/include/downloader.h index 897d3eb92..93a57603b 100644 --- a/include/downloader.h +++ b/include/downloader.h @@ -168,7 +168,10 @@ class Download { */ class Downloader { - public: + public: // types + typedef std::vector> Options; + + public: // functions Downloader(); virtual ~Downloader(); @@ -193,7 +196,7 @@ class Downloader * @param options: A series of pair to pass to aria. * @return: The newly created Download. */ - std::shared_ptr startDownload(const std::string& uri, const std::vector>& options = {}); + std::shared_ptr startDownload(const std::string& uri, const Options& options = {}); /** * Get a download corrsponding to a download id (did) @@ -215,7 +218,7 @@ class Downloader */ std::vector getDownloadIds() const; - private: + private: // data mutable std::mutex m_lock; std::map> m_knownDownloads; std::shared_ptr mp_aria; diff --git a/src/downloader.cpp b/src/downloader.cpp index d874ad899..d5a8adf7e 100644 --- a/src/downloader.cpp +++ b/src/downloader.cpp @@ -166,7 +166,7 @@ std::vector Downloader::getDownloadIds() const { return ret; } -std::shared_ptr Downloader::startDownload(const std::string& uri, const std::vector>& options) +std::shared_ptr Downloader::startDownload(const std::string& uri, const Options& options) { std::unique_lock lock(m_lock); for (auto& p: m_knownDownloads) {