CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch13/src/EventFilter/StorageManager/interface/CurlInterface.h

Go to the documentation of this file.
00001 // $Id: CurlInterface.h,v 1.3 2011/03/07 15:31:31 mommsen Exp $
00003 
00004 #ifndef EventFilter_StorageManager_CurlInterface_h
00005 #define EventFilter_StorageManager_CurlInterface_h
00006 
00007 #include <curl/curl.h>
00008 #include <string>
00009 #include <vector>
00010 
00011 
00012 namespace stor {
00013 
00022   class CurlInterface
00023   {
00024 
00025   public:
00026 
00027     typedef std::vector<char> Content;
00028 
00036     CURLcode getContent(const std::string& url, const std::string& user, Content& content);
00037 
00044     CURLcode postBinaryMessage(const std::string& url, void* buf, size_t size, Content& content);
00045 
00046     
00047   private:
00048 
00049     CURLcode do_curl(CURL*, const std::string& url, Content& content);
00050     static size_t writeToString(char* data, size_t size, size_t nmemb, Content* buffer);
00051     
00052     char errorBuffer_[CURL_ERROR_SIZE]; 
00053   };
00054 
00055 } // namespace stor
00056 
00057 #endif // EventFilter_StorageManager_CurlInterface_h
00058 
00059