Cupt
manager.hpp
Go to the documentation of this file.
1 /**************************************************************************
2 * Copyright (C) 2010 by Eugene V. Lyubimkin *
3 * *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License *
6 * (version 3 or above) as published by the Free Software Foundation. *
7 * *
8 * This program is distributed in the hope that it will be useful, *
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
11 * GNU General Public License for more details. *
12 * *
13 * You should have received a copy of the GNU GPL *
14 * along with this program; if not, write to the *
15 * Free Software Foundation, Inc., *
16 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA *
17 **************************************************************************/
18 #ifndef CUPT_DOWNLOAD_MANAGER_SEEN
19 #define CUPT_DOWNLOAD_MANAGER_SEEN
20 
22 
23 #include <functional>
24 
25 #include <cupt/common.hpp>
26 #include <cupt/fwd.hpp>
27 #include <cupt/download/uri.hpp>
28 
29 namespace cupt {
30 
31 namespace internal {
32 
33 class ManagerImpl;
34 
35 }
36 
37 namespace download {
38 
40 class CUPT_API Manager
41 {
42  internal::ManagerImpl* __impl;
43  public:
45  struct ExtendedUri
46  {
47  Uri uri;
48  string shortAlias;
49  string longAlias;
50 
52 
57  ExtendedUri(const Uri& uri_, const string& shortAlias_, const string& longAlias_)
58  : uri(uri_), shortAlias(shortAlias_), longAlias(longAlias_)
59  {}
60  };
63  {
64  vector< ExtendedUri > extendedUris;
65  string targetPath;
66  size_t size;
67 
68 
73  std::function< string () > postAction;
74  };
75 
77 
81  Manager(const shared_ptr< const Config >& config, const shared_ptr< Progress >& progress);
83  ~Manager();
84 
86 
91  string download(const vector< DownloadEntity >& entities);
92 };
93 
94 }
95 }
96 
97 #endif
98