CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CurlUtils.h
Go to the documentation of this file.
1 #ifndef EVF_CURLUTILS_H
2 #define EVF_CURLUTILS_H
3 
4 #include <string>
5 #include <sstream>
6 #include <cstring>
7 #include <cstdio>
8 
9 namespace evf{
10 
11  //______________________________________________________________________________
12  static size_t write_data(void *ptr, size_t size, size_t nmemb, void *pointer)
13  {
14  using std::string;
15  using std::ostringstream;
16  char *cfg = new char[size*nmemb+1];
17  string *spt = (string *)pointer;
18  strncpy(cfg,(const char*)ptr,size*nmemb);
19  cfg[size*nmemb] = '\0';
20  ostringstream output;
21  output<<cfg;
22  delete[] cfg;
23  (*spt) += output.str();
24  return size*nmemb;
25  }
26 
27 }
28 
29 #endif
static size_t write_data(void *ptr, size_t size, size_t nmemb, void *pointer)
Definition: CurlUtils.h:12
tuple size
Write out results.