NIM PC Cross Platform SDK
nim_qchat_public_cpp_def.h
Go to the documentation of this file.
1
11#ifndef __NIM_QCHAT_PUBLIC_CPP_DEF_H__
12#define __NIM_QCHAT_PUBLIC_CPP_DEF_H__
13
14#include <functional>
15#include <list>
16#include <map>
17#include <string>
18#include <vector>
22
23namespace nim_qchat {
24static const char* kNIMQChatWidth = "w";
25static const char* kNIMQChatHeight = "h";
26static const char* kNIMQChatDuration = "dur";
27static const char* kNIMQChatLatitude = "lat";
28static const char* kNIMQChatLongitude = "lng";
29static const char* kNIMQChatTitle = "title";
30static const char* kNIMQChatFilePath = "file_path";
31static const char* kNIMQChatURL = "url";
32static const char* kNIMQChatMD5 = "md5";
33static const char* kNIMQChatName = "name";
34static const char* kNIMQChatExt = "ext";
35static const char* kNIMQChatID = "id";
36static const char* kNIMQChatType = "type";
37static const char* kNIMQChatData = "data";
38
40struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatBaseResp {
42 uint32_t res_code = 0;
43 QChatBaseResp() = default;
44 QChatBaseResp(const NIMQChatBaseResp& c_resp) { res_code = c_resp.res_code; }
45 const NIMQChatBaseResp ToCParam() const {
46 NIMQChatBaseResp c_response{};
47 c_response.res_code = res_code;
48 return c_response;
49 }
50};
51
53struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatBusinessAntiSpamInfo {
55 std::string text_bid;
57 std::string pic_bid;
58 QChatBusinessAntiSpamInfo() = default;
60 text_bid = c_info.text_bid;
61 pic_bid = c_info.pic_bid;
62 }
63 const NIMQChatBusinessAntiSpamInfo ToCParam() const {
65 c_info.text_bid = const_cast<char*>(text_bid.c_str());
66 c_info.pic_bid = const_cast<char*>(pic_bid.c_str());
67 return c_info;
68 }
69};
70
72struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatPageInfo {
78 std::string cursor;
79 QChatPageInfo() = default;
80 QChatPageInfo(const NIMQChatPageInfo& c_info) {
81 has_more = c_info.has_more;
82 next_timestamp = c_info.next_timestamp;
83 cursor = c_info.cursor ? c_info.cursor : "";
84 }
85 const NIMQChatPageInfo ToCParam() const {
86 NIMQChatPageInfo c_info{};
87 c_info.has_more = has_more;
88 c_info.next_timestamp = next_timestamp;
89 c_info.cursor = const_cast<char*>(cursor.c_str());
90 return c_info;
91 }
92};
93
95typedef std::function<void(const QChatBaseResp&)> QChatBaseCallback;
96
97} // namespace nim_qchat
98
99#endif // __NIM_QCHAT_PUBLIC_CPP_DEF_H__
namespace nim_qchat
std::function< void(const QChatBaseResp &)> QChatBaseCallback
通用回调模板
Definition: nim_qchat_public_cpp_def.h:95
JSON辅助方法
Definition: nim_qchat_public_def.h:114
uint32_t res_code
操作结果, 参考NIMResCode
Definition: nim_qchat_public_def.h:116
Definition: nim_qchat_public_def.h:122
char * pic_bid
反垃圾图片业务id
Definition: nim_qchat_public_def.h:126
char * text_bid
反垃圾文本业务id
Definition: nim_qchat_public_def.h:124
Definition: nim_qchat_public_def.h:177
uint64_t next_timestamp
下一次分页起始时间
Definition: nim_qchat_public_def.h:181
bool has_more
是否还有更多
Definition: nim_qchat_public_def.h:179
char * cursor
下一次分页起始游标
Definition: nim_qchat_public_def.h:183
Definition: nim_qchat_public_cpp_def.h:40
Definition: nim_qchat_public_cpp_def.h:53
std::string text_bid
反垃圾文本业务id
Definition: nim_qchat_public_cpp_def.h:55
std::string pic_bid
反垃圾图片业务id
Definition: nim_qchat_public_cpp_def.h:57
Definition: nim_qchat_public_cpp_def.h:72
bool has_more
是否还有更多
Definition: nim_qchat_public_cpp_def.h:74
uint64_t next_timestamp
下一次分页起始时间
Definition: nim_qchat_public_cpp_def.h:76
std::string cursor
下一次分页起始游标
Definition: nim_qchat_public_cpp_def.h:78