libmoost
/home/mhx/git/github/libmoost/include/moost/murcl/option_setter.hpp
Go to the documentation of this file.
00001 /* vim:set ts=3 sw=3 sts=3 et: */
00036 #ifndef FM_LAST_MOOST_MURCL_OPTION_SETTER_HPP__
00037 #define FM_LAST_MOOST_MURCL_OPTION_SETTER_HPP__
00038 
00039 #include <curl/curl.h>
00040 #include "../utils/foreach.hpp"
00041 #include "options.hpp"
00042 
00043 namespace moost { namespace murcl {
00044 
00049 template <typename CurlOption, typename ValueType>
00050 struct option_setter
00051 {
00052    typedef CurlOption option;
00053    typedef ValueType value_type;
00054 
00055    static void set(
00056       typename option::handle_type handle,
00057       value_type const & parameter
00058       )
00059    {
00060       option::set(handle, parameter);
00061    }
00062 };
00063 
00067 template <typename CurlOption>
00068 struct option_setter<CurlOption, std::string>
00069 {
00070    typedef CurlOption option;
00071    typedef std::string value_type;
00072 
00073    static void set(
00074       typename option::handle_type handle,
00075       value_type const & parameter
00076       )
00077    {
00078       option::set(handle, parameter.c_str());
00079    }
00080 };
00081 
00082 }}
00083 
00084 #endif //FM_LAST_MOOST_MURCL_OPTION_SETTER_HPP__