CurlFtpInfo.h 758 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. struct CF_FileInfo
  15. {
  16. CF_FileType type; /* 文件类型 */
  17. uint64_t size; /* 文件大小 */
  18. std::string name; /* 文件名 */
  19. CF_FileInfo() : type(CF_FileType::UNKNOWN), size(0), name(""){}
  20. CF_FileInfo(CF_FileType type, uint64_t size, const std::string& name)
  21. : type(type), size(size), name(name) {}
  22. CF_FileInfo& operator=(const CF_FileInfo& info)
  23. {
  24. type = info.type;
  25. size = info.size;
  26. name = info.name;
  27. return *this;
  28. }
  29. };
  30. #endif /* CURLFTPINFO_H */