Commits

Kirill Morarenko committed 9c9ed86

make getInfo() methods const

Comments (0)

Files changed (7)

include/curlpp/Easy.hpp

 		* to retreive option.
 		*/
 		template<typename T>
-		void getInfo(CURLINFO info, T & value);
+		void getInfo(CURLINFO info, T & value) const;
 
 		std::auto_ptr<internal::CurlHandle> mCurl;
 

include/curlpp/Easy.inl

 
 
 template<typename T>
-void curlpp::Easy::getInfo(CURLINFO info, T & value)
+void curlpp::Easy::getInfo(CURLINFO info, T & value) const
 {
   mCurl->getInfo(info, value);
 }

include/curlpp/Info.hpp

 	template<CURLINFO info, typename T>
 	struct CURLPPAPI Info 
 	{
-		static void get(curlpp::Easy & handle, T & value);
-		static T get(curlpp::Easy & handle);
+		static void get(const curlpp::Easy & handle, T & value);
+		static T get(const curlpp::Easy & handle);
 	};
 
 
 	template<CURLINFO info, typename T>
 	struct CURLPPAPI NotAvailableInfo : Info<info, T>
 	{
-		static void get(curlpp::Easy & handle, T & value);
-		static T get(curlpp::Easy & handle);
+		static void get(const curlpp::Easy & handle, T & value);
+		static T get(const curlpp::Easy & handle);
 	};
 
 
 	template<typename T>
 	struct CURLPPAPI InfoTypeConverter
 	{
-		static void get(curlpp::Easy & handle, CURLINFO info, T & value);
+		static void get(const curlpp::Easy & handle, CURLINFO info, T & value);
 	}; 
 
 
 	template<>
 	void InfoTypeConverter<std::string>
-		::get(curlpp::Easy & handle, CURLINFO info, std::string & value);
+		::get(const curlpp::Easy & handle, CURLINFO info, std::string & value);
 
 
 	template<>
 	void InfoTypeConverter<std::list<std::string> >
-		::get(curlpp::Easy & handle, CURLINFO info, std::list<std::string> & value);
+		::get(const curlpp::Easy & handle, CURLINFO info, std::list<std::string> & value);
 
 
 	template<>
 	void InfoTypeConverter<long>
-		::get(curlpp::Easy & handle, CURLINFO info, long & value);
+		::get(const curlpp::Easy & handle, CURLINFO info, long & value);
 
 
 	template<>
 	void InfoTypeConverter<double>
-		::get(curlpp::Easy & handle, CURLINFO info, double & value);
+		::get(const curlpp::Easy & handle, CURLINFO info, double & value);
 
 
 	/**
 	struct CURLPPAPI InfoGetter
 	{
 		template<typename T>
-		static void get(curlpp::Easy & handle, CURLINFO info, T & value);
+		static void get(const curlpp::Easy & handle, CURLINFO info, T & value);
 	};
 
 

include/curlpp/Info.inl

 
 template<CURLINFO info, typename T>
 void
-curlpp::Info<info, T>::get(curlpp::Easy & handle, T & value)
+curlpp::Info<info, T>::get(const curlpp::Easy & handle, T & value)
 {
    curlpp::InfoTypeConverter<T>::get(handle, info, value);
 }
 
 template<CURLINFO info, typename T>
 T
-curlpp::Info<info, T>::get(curlpp::Easy & handle)
+curlpp::Info<info, T>::get(const curlpp::Easy & handle)
 {
   T value;
   curlpp::InfoTypeConverter<T>::get(handle, info, value);
 
 template<CURLINFO info, typename T>
 void
-curlpp::NotAvailableInfo<info, T>::get(curlpp::Easy &, T &)
+curlpp::NotAvailableInfo<info, T>::get(const curlpp::Easy &, T &)
 {
   throw curlpp::NotAvailable();
 }
 
 template<CURLINFO info, typename T>
 T
-curlpp::NotAvailableInfo<info, T>::get(curlpp::Easy &)
+curlpp::NotAvailableInfo<info, T>::get(const curlpp::Easy &)
 {
   throw curlpp::NotAvailable();
 }
 
 template<typename T>
 void
-curlpp::InfoGetter::get(curlpp::Easy & handle, 
+curlpp::InfoGetter::get(const curlpp::Easy & handle, 
 	                CURLINFO info,
  			T & value)
 {
 
 template<typename T>
 void
-curlpp::InfoTypeConverter<T>::get(curlpp::Easy & handle, 
+curlpp::InfoTypeConverter<T>::get(const curlpp::Easy & handle, 
 				    CURLINFO info,
 				    T & value)
 {

include/curlpp/internal/CurlHandle.hpp

 		* a pointer to a struct curl_slist * or a pointer to a double.
 		*/
 		template<typename T>
-		void getInfo(CURLINFO info, T & value);
+		void getInfo(CURLINFO info, T & value) const;
 
 
 		template<typename FunctorType>

include/curlpp/internal/CurlHandle.inl

 
 template <typename T>
 void 
-CurlHandle::getInfo(CURLINFO info, T & value)
+CurlHandle::getInfo(CURLINFO info, T & value) const
 {
 	CURLcode code;
 	code = curl_easy_getinfo(mCurl, info, & value);

src/curlpp/Info.cpp

 
 template<>
 void
-InfoTypeConverter<std::string>::get(curlpp::Easy & handle, 
+InfoTypeConverter<std::string>::get(const curlpp::Easy & handle, 
 				      CURLINFO info,
 				      std::string & value)
 {
 
 template<>
 void 
-InfoTypeConverter<std::list<std::string> >::get(curlpp::Easy & handle,
+InfoTypeConverter<std::list<std::string> >::get(const curlpp::Easy & handle,
 						   CURLINFO info,
 						   std::list<std::string> & value)
 { 
 
 template<>
 void
-InfoTypeConverter<long>::get(curlpp::Easy & handle, 
+InfoTypeConverter<long>::get(const curlpp::Easy & handle, 
 			       CURLINFO info,
 			       long & value)
 {
 
 template<>
 void
-InfoTypeConverter<double>::get(curlpp::Easy & handle, 
+InfoTypeConverter<double>::get(const curlpp::Easy & handle, 
 				 CURLINFO info,
 				 double & value)
 {