/usr/include/curlpp/Easy.hpp is in libcurlpp-dev 0.7.3-6.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 | /*
* Copyright (c) <2002-2009> <Jean-Philippe Barrette-LaPierre>
*
* 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_EASY_HPP
#define CURLPP_EASY_HPP
#include "internal/buildconfig.h"
#include "internal/CurlHandle.hpp"
#include "internal/OptionList.hpp"
#include "Option.hpp"
#include <memory>
namespace curlpp
{
/**
* Easy class.
* Detailed description.
*/
class CURLPPAPI Easy
{
public:
friend struct InfoGetter;
Easy();
/**
* This allow to have a handle, which might have
* some option set, but we don't care about them.
*/
Easy(std::auto_ptr<internal::CurlHandle> handle);
virtual ~Easy();
/**
* it will call the curl_easy_perform function will all the options
* previously set for this handle.
*/
void perform();
/**
* This function will set the option value of the OptionBase
* to the handle.
*/
virtual void setOpt(const OptionBase & option);
/**
* This function will set the option value of the OptionBase to the
* handle.
*/
virtual void setOpt(std::auto_ptr<OptionBase> option);
/**
* This function will set the option value of the OptionBase to the
* handle.
*
* Note: be carefull when using this function, see
* curlpp::OptionList::setOpt(OptionBase * option) function for more
* details.
*/
virtual void setOpt(OptionBase * option);
/**
* This function will create OptionTrait class with the value given and call
* virtual void setOpt(const OptionBase & option) with it.
*/
template<typename OptionTrait>
void setOpt(typename OptionTrait::ParamType);
/**
* Setting options from custom container with curlpp options.
*/
template<typename InputIterator>
void setOpt(InputIterator first, InputIterator last);
/**
* This function will get the current option value of the corresponding
* OptionBase. Note that if the option is not set, the option passed in
* parameter will be cleared. (See Option::getOpt for more details)
*/
void getOpt(OptionBase * option) const;
/**
* This function will get the current option value of the corresponding
* OptionBase. Note that if the option is not set, the option passed in
* parameter will be cleared. (See Option::getOpt for more details)
*/
void getOpt(OptionBase & option) const;
/**
* Get all options.
*/
//template<typename OutputIterator>
//void getOptions(OutputIterator out);
/*
* This function empties the option collection and reset all options
* to their default value
*/
virtual void reset ();
/**
* This function will return the cURL * handle.
* DO NOT use this, unless you REALLY know what you
* are doing.
*/
CURL * getHandle() const;
internal::CurlHandle & getCurlHandle() { return *mCurl; }
const internal::CurlHandle & getCurlHandle() const { return *mCurl; }
private:
/**
* This function will call the setOpt on each options
* contained by * the option list passed in argument.
*/
virtual void setOpt(const internal::OptionList & options);
/**
* This is the function that curlpp::InfoGetter will call
* to retreive option.
*/
template<typename T>
void getInfo(CURLINFO info, T & value);
std::auto_ptr<internal::CurlHandle> mCurl;
internal::OptionList mOptions;
};
} // namespace curlpp
namespace cURLpp = curlpp;
#ifdef CURLPP_INCLUDE_TEMPLATE_DEFINITIONS
#include "Easy.inl"
#endif
// Not quite sure if we shouldn't pass a const handle and clone it instead.
CURLPPAPI std::ostream & operator<<(std::ostream & stream, const curlpp::Easy & handle);
#endif // #ifndef CURLPP_EASY_HPP
|