Go to the documentation of this file.00001 #ifndef EVF_CURLUTILS_H
00002 #define EVF_CURLUTILS_H
00003
00004 #include <string>
00005 #include <sstream>
00006 #include <cstring>
00007 #include <cstdio>
00008
00009 namespace evf{
00010
00011
00012 static size_t write_data(void *ptr, size_t size, size_t nmemb, void *pointer)
00013 {
00014 using std::string;
00015 using std::ostringstream;
00016 char *cfg = new char[size*nmemb+1];
00017 string *spt = (string *)pointer;
00018 strncpy(cfg,(const char*)ptr,size*nmemb);
00019 cfg[size*nmemb] = '\0';
00020 ostringstream output;
00021 output<<cfg;
00022 delete[] cfg;
00023 (*spt) += output.str();
00024 return size*nmemb;
00025 }
00026
00027 }
00028
00029 #endif