CurlFtpInfo.h 954 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. };
  29. /**
  30. * @brief 数组信息,上传下载时使用
  31. *
  32. */
  33. struct CF_ArrayInfo
  34. {
  35. uint64_t size = 0; /* 数组大小 */
  36. uint64_t pos = 0; /* 当前位置 */
  37. char* data = nullptr; /* 数据 */
  38. };
  39. #endif /* CURLFTPINFO_H */