Cupt
method.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_METHOD_SEEN
19#define CUPT_DOWNLOAD_METHOD_SEEN
20
22
23#include <functional>
24
25#include <cupt/common.hpp>
26#include <cupt/fwd.hpp>
27
28namespace cupt {
29namespace download {
30
32class CUPT_API Method
33{
34 protected:
35 Method();
37
51 static string getAcquireSuboptionForUri(const Config& config,
52 const Uri& uri, const string& suboptionName);
54
61 static ssize_t getIntegerAcquireSuboptionForUri(const Config& config,
62 const Uri& uri, const string& suboptionName);
63 public:
65
75 virtual string perform(const Config& config, const Uri& uri,
76 const string& targetPath, const std::function< void (const vector< string >&) >& callback) = 0;
77 virtual ~Method() {}
78};
79
80}
81}
82
83#endif
84
stores library's configuration variables
Definition config.hpp:35
base class of download methods
Definition method.hpp:33
static string getAcquireSuboptionForUri(const Config &config, const Uri &uri, const string &suboptionName)
gets URI-specific value of some 'acquire::*' option
static ssize_t getIntegerAcquireSuboptionForUri(const Config &config, const Uri &uri, const string &suboptionName)
gets URI-specific value of some integer 'acquire::*' option
virtual string perform(const Config &config, const Uri &uri, const string &targetPath, const std::function< void(const vector< string > &) > &callback)=0
downloads uri to targetPath
uniform resource indentifier, "download path"
Definition uri.hpp:38