11#ifndef __NIM_QCHAT_ATTACHMENT_CPP_DEF_H__
12#define __NIM_QCHAT_ATTACHMENT_CPP_DEF_H__
22 std::string token{
""};
25 url = c_resp.
url ? c_resp.
url :
"";
30 c_resp.
url =
const_cast<char*
>(url.c_str());
31 c_resp.
token =
const_cast<char*
>(token.c_str());
41 std::string task_id{
""};
50 url = c_resp.
url ? c_resp.
url :
"";
61 std::string task_id{
""};
63 std::string file_path{
""};
81 std::string task_id{
""};
83 uint64_t total_size{0};
117 resp_holder = cb_holder(*resp);
118 return resp_holder.ToCParam();
188 std::string file_path{
""};
197 if (attachment_cbs && attachment_cbs->completed_cb)
198 (*attachment_cbs->completed_cb)(*resp);
200 delete attachment_cbs->progress_cb;
201 delete attachment_cbs;
205 if (attachment_cbs && attachment_cbs->progress_cb)
206 (*attachment_cbs->progress_cb)(*progress);
208 param.
task_id =
const_cast<char*
>(task_id.c_str());
209 param.
file_path =
const_cast<char*
>(file_path.c_str());
220 param.
task_id =
const_cast<char*
>(task_id.c_str());
244 std::string file_path{
""};
253 if (attachment_cbs && attachment_cbs->completed_cb) {
254 (*attachment_cbs->completed_cb)(*resp);
257 delete attachment_cbs->progress_cb;
258 delete attachment_cbs;
262 if (attachment_cbs && attachment_cbs->progress_cb) {
263 (*attachment_cbs->progress_cb)(*progress);
267 param.
task_id =
const_cast<char*
>(task_id.c_str());
268 param.
url =
const_cast<char*
>(url.c_str());
269 param.
file_path =
const_cast<char*
>(file_path.c_str());
280 param.
task_id =
const_cast<char*
>(task_id.c_str());
std::function< void(const QChatAttachmentUploadResp &)> AttachmentUploadCallback
上传附件回调
Definition: nim_qchat_attachment_cpp_def.h:100
std::function< QChatAttachmentCustomTokenResp(const QChatAttachmentCustomTokenResp &)> AttachmentCustomTokenCallback
获取附件自定义token回调
Definition: nim_qchat_attachment_cpp_def.h:98
std::function< void(const QChatAttachmentProgressResp &)> AttachmentProgressCallback
上传/下载附件进度回调
Definition: nim_qchat_attachment_cpp_def.h:104
std::function< void(const QChatAttachmentDownloadResp &)> AttachmentDownloadCallback
下载附件回调
Definition: nim_qchat_attachment_cpp_def.h:102
NIMQChatDownloadResType
Definition: nim_qchat_attachment_def.h:19
@ NIMQChatDownloadResTypeSource
原文件
Definition: nim_qchat_attachment_def.h:21
#define NIM_QCHAT_SDK_CPPWRAPPER_DLL_API
Definition: nim_qchat_sdk_cpp_wrapper.h:38
@ kNIMResSuccess
没有错误,一切正常
Definition: public_defines.h:26
Definition: nim_qchat_attachment_def.h:29
char * token
将该指针指向零结尾的token字符串的起始地址
Definition: nim_qchat_attachment_def.h:35
char * url
上传/下载的url
Definition: nim_qchat_attachment_def.h:33
Definition: nim_qchat_attachment_def.h:140
nim_qchat_attachment_progress_cb_func progress_cb
下载附件进度回调
Definition: nim_qchat_attachment_def.h:144
char * file_path
附件路径
Definition: nim_qchat_attachment_def.h:154
nim_qchat_attachment_download_cb_func cb
下载附件异步回调
Definition: nim_qchat_attachment_def.h:142
char * task_id
任务id, 为空时自动生成
Definition: nim_qchat_attachment_def.h:150
void * user_data
自定义用户数据
Definition: nim_qchat_attachment_def.h:146
char * url
附件url
Definition: nim_qchat_attachment_def.h:152
NIMQChatDownloadResType res_type
下载资源类型
Definition: nim_qchat_attachment_def.h:148
Definition: nim_qchat_attachment_def.h:51
uint32_t res_code
操作结果, 参考NIMResCode
Definition: nim_qchat_attachment_def.h:53
NIMQChatDownloadResType res_type
下载资源类型
Definition: nim_qchat_attachment_def.h:57
char * task_id
任务id, 自动下载的任务则为消息id
Definition: nim_qchat_attachment_def.h:59
char * file_path
下载后的文件路径
Definition: nim_qchat_attachment_def.h:61
Definition: nim_qchat_attachment_def.h:65
uint32_t res_code
操作结果, 参考NIMResCode
Definition: nim_qchat_attachment_def.h:67
uint64_t cur_size
当前已经上传/下载的大小
Definition: nim_qchat_attachment_def.h:75
uint64_t total_size
文件总大小
Definition: nim_qchat_attachment_def.h:73
char * task_id
下载任务id
Definition: nim_qchat_attachment_def.h:71
Definition: nim_qchat_attachment_def.h:88
nim_qchat_attachment_custom_token_cb_func cb
自定义token回调
Definition: nim_qchat_attachment_def.h:90
Definition: nim_qchat_attachment_def.h:104
nim_qchat_attachment_download_cb_func cb
下载附件全局异步回调
Definition: nim_qchat_attachment_def.h:106
Definition: nim_qchat_attachment_def.h:112
nim_qchat_attachment_progress_cb_func cb
上传/下载全局进度回调
Definition: nim_qchat_attachment_def.h:114
Definition: nim_qchat_attachment_def.h:96
nim_qchat_attachment_upload_cb_func cb
上传附件全局异步回调
Definition: nim_qchat_attachment_def.h:98
Definition: nim_qchat_attachment_def.h:158
char * task_id
任务id, 为空时自动生成
Definition: nim_qchat_attachment_def.h:160
Definition: nim_qchat_attachment_def.h:134
char * task_id
任务id, 为空时自动生成
Definition: nim_qchat_attachment_def.h:136
Definition: nim_qchat_attachment_def.h:120
nim_qchat_attachment_progress_cb_func progress_cb
上传附件进度回调
Definition: nim_qchat_attachment_def.h:124
char * file_path
附件路径
Definition: nim_qchat_attachment_def.h:130
nim_qchat_attachment_upload_cb_func cb
上传附件异步回调
Definition: nim_qchat_attachment_def.h:122
void * user_data
自定义用户数据
Definition: nim_qchat_attachment_def.h:126
char * task_id
任务id, 为空时自动生成
Definition: nim_qchat_attachment_def.h:128
Definition: nim_qchat_attachment_def.h:39
uint32_t res_code
操作结果, 参考NIMResCode
Definition: nim_qchat_attachment_def.h:41
char * task_id
任务id
Definition: nim_qchat_attachment_def.h:45
char * url
上传后的url
Definition: nim_qchat_attachment_def.h:47
Definition: nim_qchat_attachment_cpp_def.h:226
AttachmentDownloadCallback * completed_cb
Definition: nim_qchat_attachment_cpp_def.h:227
AttachmentProgressCallback * progress_cb
Definition: nim_qchat_attachment_cpp_def.h:228
Definition: nim_qchat_attachment_cpp_def.h:18
NIMQChatAttachmentCustomTokenResp ToCParam()
Definition: nim_qchat_attachment_cpp_def.h:28
QChatAttachmentCustomTokenResp()=default
QChatAttachmentCustomTokenResp(const NIMQChatAttachmentCustomTokenResp &c_resp)
Definition: nim_qchat_attachment_cpp_def.h:24
Definition: nim_qchat_attachment_cpp_def.h:232
std::string task_id
任务id, 为空时自动生成
Definition: nim_qchat_attachment_cpp_def.h:240
NIMQChatAttachmentDownloadParam ToCParam() const
Definition: nim_qchat_attachment_cpp_def.h:245
Definition: nim_qchat_attachment_cpp_def.h:55
QChatAttachmentDownloadResp()=default
QChatAttachmentDownloadResp(const NIMQChatAttachmentDownloadResp &c_resp)
Definition: nim_qchat_attachment_cpp_def.h:65
Definition: nim_qchat_attachment_cpp_def.h:76
QChatAttachmentProgressResp(const NIMQChatAttachmentProgressResp &c_resp)
Definition: nim_qchat_attachment_cpp_def.h:87
QChatAttachmentProgressResp()=default
Definition: nim_qchat_attachment_cpp_def.h:107
NIMQChatAttachmentRegCustomTokenCbParam ToCParam() const
Definition: nim_qchat_attachment_cpp_def.h:110
Definition: nim_qchat_attachment_cpp_def.h:142
NIMQChatAttachmentRegDownloadCbParam ToCParam() const
Definition: nim_qchat_attachment_cpp_def.h:145
Definition: nim_qchat_attachment_cpp_def.h:158
NIMQChatAttachmentRegProgressCbParam ToCParam() const
Definition: nim_qchat_attachment_cpp_def.h:161
Definition: nim_qchat_attachment_cpp_def.h:125
NIMQChatAttachmentRegUploadCbParam ToCParam() const
Definition: nim_qchat_attachment_cpp_def.h:128
Definition: nim_qchat_attachment_cpp_def.h:275
NIMQChatAttachmentStopDownloadParam ToCParam() const
Definition: nim_qchat_attachment_cpp_def.h:278
std::string task_id
任务id
Definition: nim_qchat_attachment_cpp_def.h:277
Definition: nim_qchat_attachment_cpp_def.h:215
std::string task_id
任务id
Definition: nim_qchat_attachment_cpp_def.h:217
NIMQChatAttachmentStopUploadParam ToCParam() const
Definition: nim_qchat_attachment_cpp_def.h:218
Definition: nim_qchat_attachment_cpp_def.h:180
std::string task_id
任务id, 为空时自动生成
Definition: nim_qchat_attachment_cpp_def.h:186
NIMQChatAttachmentUploadParam ToCParam() const
Definition: nim_qchat_attachment_cpp_def.h:189
Definition: nim_qchat_attachment_cpp_def.h:37
QChatAttachmentUploadResp(const NIMQChatAttachmentUploadResp &c_resp)
Definition: nim_qchat_attachment_cpp_def.h:45
QChatAttachmentUploadResp()=default
Definition: nim_qchat_attachment_cpp_def.h:174
AttachmentUploadCallback * completed_cb
Definition: nim_qchat_attachment_cpp_def.h:175
AttachmentProgressCallback * progress_cb
Definition: nim_qchat_attachment_cpp_def.h:176