1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- #ifndef CURLFTP_H
- #define CURLFTP_H
- #include "curl/curl.h"
- #include <string>
- #include <vector>
- #include <mutex>
- class CurlFtp
- {
- public:
- CurlFtp();
- ~CurlFtp();
-
- static std::string listDir(const std::string &ftpUrl, const std::string &username, const std::string &password);
-
- static bool listFiles(const std::string &ftpUrl, const std::string &username, const std::string &password, std::vector<std::string>& fileList);
-
-
-
-
-
- static bool createDir(const std::string &ftpUrl, const std::string &username, const std::string &password, const std::string &dirName);
-
- bool setFtpIPAndPort(const std::string& IP, const std::string& port);
-
- bool setFtpUsernameAndPassword(const std::string& username, const std::string& password);
-
- bool listAll(std::string dir, std::vector<std::string>& fileList);
- private:
- std::mutex m_mutexCurl;
- CURL* m_curl = nullptr;
- CURLcode m_res = CURLE_OK;
- std::string m_responseString;
- std::string m_IP;
- std::string m_port;
- std::string m_ftpUrl;
- std::string m_username;
- std::string m_password;
- std::string m_dirName;
- };
- #endif
|