NIM 跨平台 C++ SDK
载入中...
搜索中...
未找到
v2_nim_utilities.hpp
浏览该文件的文档.
1#ifndef V2_NIM_UTILITIES_H
2#define V2_NIM_UTILITIES_H
4namespace v2 {
7public:
19
35 nstd::string name,
36 nstd::string sceneName,
37 uint32_t width,
38 uint32_t height);
39
53 static nstd::optional<V2NIMMessage> createAudioMessage(nstd::string audioPath, nstd::string name, nstd::string sceneName, uint32_t duration);
54
71 nstd::string name,
72 nstd::string sceneName,
73 uint32_t duration,
74 uint32_t width,
75 uint32_t height);
76
90
103 static nstd::optional<V2NIMMessage> createLocationMessage(double latitude, double longitude, nstd::string address);
104
117
134
146
158
174 const nstd::string& channelId,
175 int32_t status,
177 const nstd::string& text);
178};
179
181public:
186
191};
192
195public:
207
223 nstd::string name,
224 nstd::string sceneName,
225 uint32_t width,
226 uint32_t height);
227
242 nstd::string name,
243 nstd::string sceneName,
244 uint32_t duration);
245
262 nstd::string name,
263 nstd::string sceneName,
264 uint32_t duration,
265 uint32_t width,
266 uint32_t height);
267
281
294 static nstd::optional<V2NIMChatroomMessage> createLocationMessage(double latitude, double longitude, nstd::string address);
295
307
324 int32_t subType);
325
337
349};
350
353public:
361 static nstd::string p2pConversationId(const nstd::string& accountId);
362
370 static nstd::string teamConversationId(const nstd::string& teamId);
371
379 static nstd::string superTeamConversationId(const nstd::string& superTeamId);
380
388 static V2NIMConversationType parseConversationType(const nstd::string& conversationId);
389
397 static nstd::string parseConversationTargetId(const nstd::string& conversationId);
398};
399
402public:
412};
413
415public:
424 static nstd::string imageThumbUrl(const nstd::string& url, int32_t thumbSize);
425
436 static nstd::string videoCoverUrl(const nstd::string& url, int32_t offset, int32_t thumbSize, const nstd::string& type);
437};
438
440public:
451 double longitude,
452 const nstd::string& address);
453};
454
455} // namespace v2
456
457#endif
Definition: ne_stl_continuous_container.h:15
Definition: ne_stl_smart_ptr.h:30
Definition: ne_stl_string.h:19
聊天室消息创建器
Definition: v2_nim_utilities.hpp:194
static nstd::optional< V2NIMChatroomMessage > createTextMessage(nstd::string text)
创建文本消息
Definition: v2_nim_internal.hpp:204
static nstd::optional< V2NIMChatroomMessage > createCustomMessageWithAttachment(nstd::shared_ptr< V2NIMMessageCustomAttachment > attachment, int32_t subType)
创建群聊自定义消息
Definition: v2_nim_internal.hpp:241
static nstd::optional< V2NIMChatroomMessage > createLocationMessage(double latitude, double longitude, nstd::string address)
创建位置消息
Definition: v2_nim_internal.hpp:233
static nstd::optional< V2NIMChatroomMessage > createFileMessage(nstd::string filePath, nstd::string name, nstd::string sceneName)
创建文件消息
Definition: v2_nim_internal.hpp:228
static nstd::optional< V2NIMChatroomMessage > createTipsMessage(nstd::string text)
创建提示消息
Definition: v2_nim_internal.hpp:246
static nstd::optional< V2NIMChatroomMessage > createImageMessage(nstd::string imagePath, nstd::string name, nstd::string sceneName, uint32_t width, uint32_t height)
创建图片消息
Definition: v2_nim_internal.hpp:207
static nstd::optional< V2NIMChatroomMessage > createForwardMessage(V2NIMChatroomMessage message)
创建转发消息
Definition: v2_nim_internal.hpp:249
static nstd::optional< V2NIMChatroomMessage > createVideoMessage(nstd::string videoPath, nstd::string name, nstd::string sceneName, uint32_t duration, uint32_t width, uint32_t height)
创建视频消息
Definition: v2_nim_internal.hpp:220
static nstd::optional< V2NIMChatroomMessage > createCustomMessage(nstd::string rawAttachment)
创建自定义消息
Definition: v2_nim_internal.hpp:238
static nstd::optional< V2NIMChatroomMessage > createAudioMessage(nstd::string audioPath, nstd::string name, nstd::string sceneName, uint32_t duration)
创建音频消息
Definition: v2_nim_internal.hpp:214
本地反垃圾工具
Definition: v2_nim_utilities.hpp:401
static V2NIMClientAntispamResult checkTextAntispam(nstd::string text, nstd::string replace)
文本本地反垃圾
Definition: v2_nim_internal.hpp:284
会话ID工具
Definition: v2_nim_utilities.hpp:352
static nstd::string superTeamConversationId(const nstd::string &superTeamId)
获取超级群会话ID
Definition: v2_nim_internal.hpp:275
static V2NIMConversationType parseConversationType(const nstd::string &conversationId)
获取会话ID对应的会话类型
Definition: v2_nim_internal.hpp:278
static nstd::string p2pConversationId(const nstd::string &accountId)
获取点对点会话ID
Definition: v2_nim_internal.hpp:269
static nstd::string teamConversationId(const nstd::string &teamId)
获取群组会话ID
Definition: v2_nim_internal.hpp:272
static nstd::string parseConversationTargetId(const nstd::string &conversationId)
获取会话ID对应的目标ID
Definition: v2_nim_internal.hpp:281
Definition: v2_nim_utilities.hpp:439
static nstd::shared_ptr< V2NIMMessageLocationAttachment > createLocationMessageAttachment(double latitude, double longitude, const nstd::string &address)
构造地理位置消息附件
Definition: v2_nim_internal.hpp:264
Definition: v2_nim_utilities.hpp:180
static nstd::optional< nstd::string > messageSerialization(const V2NIMMessage &message)
将 V2NIMMessage 序列化为字符串
Definition: v2_nim_internal.hpp:252
static nstd::optional< V2NIMMessage > messageDeserialization(const nstd::string &messageString)
将字符串反序列化为 V2NIMMessage
Definition: v2_nim_internal.hpp:255
IM 消息创建器
Definition: v2_nim_utilities.hpp:6
static nstd::optional< V2NIMMessage > createCustomMessage(nstd::string text, nstd::string rawAttachment)
创建自定义消息
Definition: v2_nim_internal.hpp:183
static nstd::optional< V2NIMMessage > createFileMessage(nstd::string filePath, nstd::string name, nstd::string sceneName)
创建文件消息
Definition: v2_nim_internal.hpp:177
static nstd::optional< V2NIMMessage > createAudioMessage(nstd::string audioPath, nstd::string name, nstd::string sceneName, uint32_t duration)
创建音频消息
Definition: v2_nim_internal.hpp:163
static nstd::optional< V2NIMMessage > createImageMessage(nstd::string imagePath, nstd::string name, nstd::string sceneName, uint32_t width, uint32_t height)
创建图片消息
Definition: v2_nim_internal.hpp:156
static nstd::optional< V2NIMMessage > createLocationMessage(double latitude, double longitude, nstd::string address)
创建位置消息
Definition: v2_nim_internal.hpp:180
static nstd::optional< V2NIMMessage > createVideoMessage(nstd::string videoPath, nstd::string name, nstd::string sceneName, uint32_t duration, uint32_t width, uint32_t height)
创建视频消息
Definition: v2_nim_internal.hpp:169
static nstd::optional< V2NIMMessage > createTipsMessage(nstd::string text)
创建提示消息
Definition: v2_nim_internal.hpp:190
static nstd::optional< V2NIMMessage > createCustomMessageWithAttachment(nstd::shared_ptr< V2NIMMessageCustomAttachment > attachment, int32_t subType)
创建群聊自定义消息
Definition: v2_nim_internal.hpp:186
static nstd::optional< V2NIMMessage > createCallMessage(int32_t type, const nstd::string &channelId, int32_t status, const nstd::vector< V2NIMMessageCallDuration > &durations, const nstd::string &text)
构造话单消息
Definition: v2_nim_internal.hpp:196
static nstd::optional< V2NIMMessage > createForwardMessage(V2NIMMessage message)
创建转发消息
Definition: v2_nim_internal.hpp:193
static nstd::optional< V2NIMMessage > createTextMessage(nstd::string text)
创建文本消息
Definition: v2_nim_internal.hpp:153
Definition: v2_nim_utilities.hpp:414
static nstd::string videoCoverUrl(const nstd::string &url, int32_t offset, int32_t thumbSize, const nstd::string &type)
获取视频封面
Definition: v2_nim_internal.hpp:261
static nstd::string imageThumbUrl(const nstd::string &url, int32_t thumbSize)
获取图片缩略图
Definition: v2_nim_internal.hpp:258
Definition: v2_nim_ai_service.hpp:4
V2NIMConversationType
Definition: v2_nim_def_enum.hpp:909
Definition: ne_stl_optional.h:16
Definition: v2_nim_def_struct.hpp:1856
Definition: v2_nim_def_struct.hpp:919
Definition: v2_nim_def_struct.hpp:643