22#ifndef COS_CPP_SDK_V5_INCLUDE_OP_BASE_OP_H_
33#define COS_CPP_SDK_V5_INCLUDE_OP_BASE_OP_H_
44
5- #include < inttypes.h>
65#include < stdint.h>
76
87#include < map>
1110#include " cos_config.h"
1211#include " op/cos_result.h"
1312#include " trsf/transfer_handler.h"
13+ #include " util/base_op_util.h"
1414
1515namespace qcloud_cos {
1616
@@ -22,7 +22,7 @@ class BaseOp {
2222 // / \brief BaseOp构造函数
2323 // /
2424 // / \param cos_conf Cos配置
25- explicit BaseOp (const SharedConfig& cos_conf) : m_config(cos_conf) {}
25+ explicit BaseOp (const SharedConfig& cos_conf) : m_config(cos_conf), m_op_util(m_config) {}
2626
2727 BaseOp () {}
2828
@@ -51,12 +51,8 @@ class BaseOp {
5151
5252 bool IsDomainSameToHost () const ;
5353
54- bool UseDefaultDomain () const ;
55-
5654 bool IsDefaultHost (const std::string &host) const ;
5755
58- std::string ChangeHostSuffix (const std::string &host);
59-
6056 // / \brief 封装了cos Service/Bucket/Object 相关接口的通用操作,
6157 // / 包括签名计算、请求发送、返回内容解析等
6258 // /
@@ -128,6 +124,28 @@ class BaseOp {
128124 protected:
129125 bool CheckConfigValidation () const ;
130126 SharedConfig m_config;
127+ BaseOpUtil m_op_util;
128+
129+ private:
130+ CosResult NormalRequest (
131+ const std::string& host, const std::string& path, const BaseReq& req,
132+ const std::map<std::string, std::string>& additional_headers,
133+ const std::map<std::string, std::string>& additional_params,
134+ const std::string& req_body, bool check_body, BaseResp* resp,
135+ const uint32_t &request_retry_num, bool is_ci_req = false );
136+
137+ CosResult DownloadRequest (const std::string& host, const std::string& path,
138+ const BaseReq& req, BaseResp* resp, std::ostream& os,
139+ const uint32_t &request_retry_num,
140+ const SharedTransferHandler& handler = nullptr );
141+
142+ CosResult UploadRequest (
143+ const std::string& host, const std::string& path, const BaseReq& req,
144+ const std::map<std::string, std::string>& additional_headers,
145+ const std::map<std::string, std::string>& additional_params,
146+ std::istream& is, BaseResp* resp, const uint32_t &request_retry_num, const SharedTransferHandler& handler = nullptr );
147+
148+ bool NoNeedRetry (const CosResult &result);
131149};
132150
133151} // namespace qcloud_cos
0 commit comments