Cupt
|
00001 /************************************************************************** 00002 * Copyright (C) 2010 by Eugene V. Lyubimkin * 00003 * * 00004 * This program is free software; you can redistribute it and/or modify * 00005 * it under the terms of the GNU General Public License * 00006 * (version 3 or above) as published by the Free Software Foundation. * 00007 * * 00008 * This program is distributed in the hope that it will be useful, * 00009 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00010 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00011 * GNU General Public License for more details. * 00012 * * 00013 * You should have received a copy of the GNU GPL * 00014 * along with this program; if not, write to the * 00015 * Free Software Foundation, Inc., * 00016 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * 00017 **************************************************************************/ 00018 #ifndef CUPT_DOWNLOAD_METHOD_SEEN 00019 #define CUPT_DOWNLOAD_METHOD_SEEN 00020 00022 00023 #include <functional> 00024 00025 #include <cupt/common.hpp> 00026 #include <cupt/fwd.hpp> 00027 00028 namespace cupt { 00029 namespace download { 00030 00032 class CUPT_API Method 00033 { 00034 protected: 00035 Method(); 00037 00051 static string getAcquireSuboptionForUri(const shared_ptr< const Config >& config, 00052 const Uri& uri, const string& suboptionName); 00054 00061 static ssize_t getIntegerAcquireSuboptionForUri(const shared_ptr< const Config >& config, 00062 const Uri& uri, const string& suboptionName); 00063 public: 00065 00075 virtual string perform(const shared_ptr< const Config >& config, const Uri& uri, 00076 const string& targetPath, const std::function< void (const vector< string >&) >& callback) = 0; 00077 }; 00078 00079 } 00080 } 00081 00082 #endif 00083