Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef CUPT_DOWNLOAD_MANAGER_SEEN
00019 #define CUPT_DOWNLOAD_MANAGER_SEEN
00020
00022
00023 #include <functional>
00024
00025 #include <cupt/common.hpp>
00026 #include <cupt/fwd.hpp>
00027 #include <cupt/download/uri.hpp>
00028
00029 namespace cupt {
00030
00031 namespace internal {
00032
00033 class ManagerImpl;
00034
00035 }
00036
00037 namespace download {
00038
00040 class CUPT_API Manager
00041 {
00042 internal::ManagerImpl* __impl;
00043 public:
00045 struct ExtendedUri
00046 {
00047 Uri uri;
00048 string shortAlias;
00049 string longAlias;
00050
00052
00057 ExtendedUri(const Uri& uri_, const string& shortAlias_, const string& longAlias_)
00058 : uri(uri_), shortAlias(shortAlias_), longAlias(longAlias_)
00059 {}
00060 };
00062 struct DownloadEntity
00063 {
00064 vector< ExtendedUri > extendedUris;
00065 string targetPath;
00066 size_t size;
00067
00068
00073 std::function< string () > postAction;
00074 };
00075
00077
00081 Manager(const shared_ptr< const Config >& config, const shared_ptr< Progress >& progress);
00083 ~Manager();
00084
00086
00091 string download(const vector< DownloadEntity >& entities);
00092 };
00093
00094 }
00095 }
00096
00097 #endif
00098