SHARE
TWEET

Untitled

a guest Apr 4th, 2014 72 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #ifndef md5hashDest_getFiles_h
  2. #define md5hashDest_getFiles_h
  3.  
  4. #include <curl/curl.h>
  5. #include <string>
  6. #include <stdio.h>
  7. #include <iostream>
  8.  
  9.  
  10. class getFiles {
  11.     CURL *curl;
  12.     CURLcode res;
  13.     std::string URL;
  14.     struct FtpFile {
  15.     std::string filename;
  16.     std::string destination;
  17.     FILE *stream;
  18.     }ftpfile;
  19.    
  20. public:
  21.     // CURL CONSTRUCTOR
  22.     getFiles(std::string filen, FILE *file = NULL, std::string urlname = "http://localhost/updates/") {
  23.         getDir(filen);
  24.         ftpfile.filename = filen;
  25.         ftpfile.stream = file;
  26.         URL = urlname;
  27.         curl_global_init(CURL_GLOBAL_DEFAULT);
  28.         curl = curl_easy_init();
  29.     }
  30.     // CURL DESTRUCTOR
  31.     ~getFiles() {
  32.         curl_global_cleanup();
  33.         //std::cout << "/////////////////////////////////////////" << std::endl << "       DESTRUCTOR CALLED!" << std::endl;
  34.     }
  35.     static size_t my_fwrite(void *buffer, size_t size, size_t nmemb, void *stream);
  36.  
  37.     void run();
  38. };
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top