CurlFtpInfo.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #ifndef CURLFTPINFO_H
  2. #define CURLFTPINFO_H
  3. #include <string>
  4. #include <regex>
  5. /* 文件类型 */
  6. enum class CF_FileType
  7. {
  8. FILE,
  9. DIR,
  10. LINK,
  11. UNKNOWN
  12. };
  13. /* 上传下载类型 */
  14. enum class CF_TransType
  15. {
  16. UPLOAD = 0, /* 上传 */
  17. DOWNLOAD /* 下载 */
  18. };
  19. /* 文件信息 */
  20. struct CF_FileInfo
  21. {
  22. CF_FileType type; /* 文件类型 */
  23. uint64_t size; /* 文件大小 */
  24. std::string name; /* 文件名 */
  25. CF_FileInfo() : type(CF_FileType::UNKNOWN), size(0), name(""){}
  26. CF_FileInfo(CF_FileType type, uint64_t size, const std::string& name)
  27. : type(type), size(size), name(name) {}
  28. CF_FileInfo& operator=(const CF_FileInfo& info)
  29. {
  30. type = info.type;
  31. size = info.size;
  32. name = info.name;
  33. return *this;
  34. }
  35. };
  36. /**
  37. * @brief 数组信息,上传下载时使用
  38. *
  39. */
  40. struct CF_ArrayInfo
  41. {
  42. uint64_t size = 0; /* 数组大小 */
  43. uint64_t pos = 0; /* 当前位置 */
  44. char* data = nullptr; /* 数据 */
  45. };
  46. #endif /* CURLFTPINFO_H */