/* * Copyright (c) <2002-2009> * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files * (curlpp), to deal in the Software without restriction, * including without limitation the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef CURLPP_OPTION_SETTER_HPP #define CURLPP_OPTION_SETTER_HPP #include "OptionContainerType.hpp" #include "CurlHandle.hpp" #include "../Types.hpp" namespace curlpp { namespace internal { /** * Defines the way options are set. */ template class OptionSetter { public: typedef typename internal::OptionContainerType::HandleOptionType ParamType; static void setOpt(internal::CurlHandle * handle, ParamType value); }; /** * Specialization. */ template class OptionSetter { public: typedef curlpp::internal::OptionContainerType::HandleOptionType ParamType; static void setOpt(internal::CurlHandle * handle, ParamType value); }; /** * Specialization. */ template class OptionSetter, optionType> { public: typedef std::list OptionValueType; typedef curlpp::internal::OptionContainerType::HandleOptionType ParamType; static void setOpt(internal::CurlHandle * handle, ParamType value); }; /** * Specialization. */ template<> class OptionSetter { public: typedef curlpp::Forms OptionValueType; typedef curlpp::internal::OptionContainerType::HandleOptionType ParamType; static void setOpt(internal::CurlHandle * handle, ParamType value); }; /** * Specialization. */ template<> class OptionSetter { public: typedef curlpp::types::WriteFunctionFunctor OptionValueType; typedef curlpp::internal::OptionContainerType::HandleOptionType ParamType; static void setOpt(internal::CurlHandle * handle, ParamType value); }; #ifdef HAVE_BOOST /** * Specialization. */ template<> class OptionSetter { public: typedef curlpp::types::BoostWriteFunction OptionValueType; typedef curlpp::internal::OptionContainerType::HandleOptionType ParamType; static void setOpt(internal::CurlHandle * handle, ParamType value); }; #endif // #ifdef HAVE_BOOST /** * Specialization. */ template<> class OptionSetter { public: typedef FILE * OptionValueType; typedef curlpp::internal::OptionContainerType::HandleOptionType ParamType; static void setOpt(internal::CurlHandle * handle, ParamType value); }; /** * Specialization. */ template<> class OptionSetter { public: typedef std::ostream * OptionValueType; typedef curlpp::internal::OptionContainerType::HandleOptionType ParamType; static void setOpt(internal::CurlHandle * handle, ParamType value); }; /** * Specialization. */ template<> class OptionSetter { public: typedef curlpp::types::ReadFunctionFunctor OptionValueType; typedef curlpp::internal::OptionContainerType::HandleOptionType ParamType; static void setOpt(internal::CurlHandle * handle, ParamType value); }; #ifdef HAVE_BOOST /** * Specialization. */ template<> class OptionSetter { public: typedef curlpp::types::BoostReadFunction OptionValueType; typedef curlpp::internal::OptionContainerType::HandleOptionType ParamType; static void setOpt(internal::CurlHandle * handle, ParamType value); }; #endif // #ifdef HAVE_BOOST /** * Specialization. */ template <> class OptionSetter { public: typedef FILE * OptionValueType; typedef curlpp::internal::OptionContainerType::HandleOptionType ParamType; static void setOpt(internal::CurlHandle * handle, ParamType value); }; /** * Specialization. */ template<> class OptionSetter { public: typedef std::istream * OptionValueType; typedef curlpp::internal::OptionContainerType::HandleOptionType ParamType; static void setOpt(internal::CurlHandle * handle, ParamType value); }; /** * Specialization. */ template<> class OptionSetter { public: typedef curlpp::types::ProgressFunctionFunctor OptionValueType; typedef curlpp::internal::OptionContainerType::HandleOptionType ParamType; static void setOpt(internal::CurlHandle * handle, ParamType value); }; #ifdef HAVE_BOOST /** * Specialization. */ template<> class OptionSetter { public: typedef curlpp::types::BoostProgressFunction OptionValueType; typedef curlpp::internal::OptionContainerType::HandleOptionType ParamType; static void setOpt(internal::CurlHandle * handle, ParamType value); }; #endif // #ifdef HAVE_BOOST /** * Specialization. */ template<> class OptionSetter { public: typedef curlpp::types::WriteFunctionFunctor OptionValueType; typedef curlpp::internal::OptionContainerType::HandleOptionType ParamType; static void setOpt(internal::CurlHandle * handle, ParamType value); }; #ifdef HAVE_BOOST /** * Specialization. */ template<> class OptionSetter { public: typedef curlpp::types::BoostWriteFunction OptionValueType; typedef curlpp::internal::OptionContainerType::HandleOptionType ParamType; static void setOpt(internal::CurlHandle * handle, ParamType value); }; #endif // #ifdef HAVE_BOOST /** * Specialization. */ template<> class OptionSetter { public: typedef curlpp::types::DebugFunctionFunctor OptionValueType; typedef curlpp::internal::OptionContainerType::HandleOptionType ParamType; static void setOpt(internal::CurlHandle * handle, ParamType value); }; #ifdef HAVE_BOOST /** * Specialization. */ template<> class OptionSetter { public: typedef curlpp::types::BoostDebugFunction OptionValueType; typedef curlpp::internal::OptionContainerType::HandleOptionType ParamType; static void setOpt(internal::CurlHandle * handle, ParamType value); }; #endif // #ifdef HAVE_BOOST /** * Specialization. */ template<> class OptionSetter { public: typedef curlpp::types::SslCtxFunctionFunctor OptionValueType; typedef curlpp::internal::OptionContainerType::HandleOptionType ParamType; static void setOpt(internal::CurlHandle * handle, ParamType value); }; #ifdef HAVE_BOOST /** * Specialization. */ template<> class OptionSetter { public: typedef curlpp::types::BoostSslCtxFunction OptionValueType; typedef curlpp::internal::OptionContainerType::HandleOptionType ParamType; static void setOpt(internal::CurlHandle * handle, ParamType value); }; #endif // #ifdef HAVE_BOOST } // namespace internal } // namespace curlpp namespace cURLpp = curlpp; #include "OptionSetter.inl" #endif // #ifndef CURLPP_OPTION_SETTER_HPP