12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- #ifndef CURLFTPINFO_H
- #define CURLFTPINFO_H
- #include <string>
- #include <regex>
- /* 文件类型 */
- enum class CF_FileType
- {
- FILE,
- DIR,
- LINK,
- UNKNOWN
- };
- /* 上传下载类型 */
- enum class CF_TransType
- {
- UPLOAD = 0, /* 上传 */
- DOWNLOAD /* 下载 */
- };
- /* 文件信息 */
- struct CF_FileInfo
- {
- CF_FileType type; /* 文件类型 */
- uint64_t size; /* 文件大小 */
- std::string name; /* 文件名 */
- CF_FileInfo() : type(CF_FileType::UNKNOWN), size(0), name(""){}
- CF_FileInfo(CF_FileType type, uint64_t size, const std::string& name)
- : type(type), size(size), name(name) {}
-
- CF_FileInfo& operator=(const CF_FileInfo& info)
- {
- type = info.type;
- size = info.size;
- name = info.name;
- return *this;
- }
- };
- /**
- * @brief 数组信息,上传下载时使用
- *
- */
- struct CF_ArrayInfo
- {
- uint64_t size = 0; /* 数组大小 */
- uint64_t pos = 0; /* 当前位置 */
- char* data = nullptr; /* 数据 */
- };
- #endif /* CURLFTPINFO_H */
|