Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef md5hashDest_getFiles_h
- #define md5hashDest_getFiles_h
- #include <curl/curl.h>
- #include <string>
- #include <stdio.h>
- #include <iostream>
- class getFiles {
- CURL *curl;
- CURLcode res;
- std::string URL;
- struct FtpFile {
- std::string filename;
- std::string destination;
- FILE *stream;
- }ftpfile;
- public:
- // CURL CONSTRUCTOR
- getFiles(std::string filen, FILE *file = NULL, std::string urlname = "http://localhost/updates/") {
- getDir(filen);
- ftpfile.filename = filen;
- ftpfile.stream = file;
- URL = urlname;
- curl_global_init(CURL_GLOBAL_DEFAULT);
- curl = curl_easy_init();
- }
- // CURL DESTRUCTOR
- ~getFiles() {
- curl_global_cleanup();
- //std::cout << "/////////////////////////////////////////" << std::endl << " DESTRUCTOR CALLED!" << std::endl;
- }
- static size_t my_fwrite(void *buffer, size_t size, size_t nmemb, void *stream);
- void run();
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement