123456789101112131415161718192021222324252627282930 |
- #ifndef CURLFTP_H
- #define CURLFTP_H
- #include "curl.h"
- #include <string>
- class CurlFtp
- {
- public:
- CurlFtp();
- ~CurlFtp();
- /* 列出FTP文件夹 */
- 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);
- /* 检查文件夹是否存在 */
- // static bool isDirExists(const std::string &ftpUrl, const std::string &username, const std::string &password);
- /* 使用正则表达式提取出文件夹 */
- // static bool CurlFtp::extractDirectories(const std::string& responseString);
- /* 回调函数 */
- static size_t writeCallback(void *contents, size_t size, size_t nmemb, std::string *s);
- /* 创建文件夹 */
- static bool createDir(const std::string &ftpUrl, const std::string &username, const std::string &password, const std::string &dirName);
- };
- #endif /* CURLFTP_H */
|