#ifndef CURLFTPINFO_H #define CURLFTPINFO_H #include #include /* Std 异常处理的宏 */ #define StdCatch \ catch (const std::exception& e)\ {\ SPDLOG_WARN("Std std failed: {}", e.what());\ return false;\ }catch(...)\ {\ SPDLOG_WARN("Std Operated failed: unknown error");\ return false;\ } /* Std 异常处理的宏,不带返回值 */ #define StdCatchNoReturn \ catch (const std::exception& e)\ {\ SPDLOG_WARN("Std std failed: {}", e.what());\ return;\ }catch(...)\ {\ SPDLOG_WARN("Std Operated failed: unknown error");\ return;\ } /* 文件类型 */ 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) {} }; /** * @brief 数组信息,上传下载时使用 * */ struct CF_ArrayInfo { uint64_t size = 0; /* 数组大小 */ uint64_t pos = 0; /* 当前位置 */ char* data = nullptr; /* 数据 */ }; #endif /* CURLFTPINFO_H */