NIM PC Cross Platform SDK
nim_cpp_global.h
Go to the documentation of this file.
1
7#ifndef _NIM_SDK_CPP_GLOBAL_H_
8#define _NIM_SDK_CPP_GLOBAL_H_
9
10#include <functional>
11#include <string>
13#include "nim_define_include.h"
18namespace nim {
19
23class NIM_SDK_CPPWRAPPER_DLL_API Global {
24public:
25 struct NIM_SDK_CPPWRAPPER_DLL_API CachedFileInfo {
26 std::string file_type_;
27 std::string file_path_;
28 int file_count_;
29 int64_t file_total_size_;
30 };
31 struct NIM_SDK_CPPWRAPPER_DLL_API SDKDBErrorInfo {
41 };
42 std::string db_name_;
43 int error_code_;
44 int operation_;
45 std::string description_;
46 std::string attach_;
47 };
48 typedef std::function<void(bool conncet, NIMProxyDetectStep step, const std::string& json_extension)> DetectProxyCallback;
49 typedef std::function<void(NIMSDKException exception, const std::string& log)> ExceptionCallback;
50 typedef std::function<void(NIMResCode rescode, const CachedFileInfo& info)> GetCachedFileInfoCallback;
51 typedef std::function<void(NIMResCode rescode)> DeleteCachedFileCallback;
52 typedef DeleteCachedFileCallback SDKFeedbackCallback;
53 typedef std::function<void(const SDKDBErrorInfo& error_info)> SDKDBErrorCallback;
54
55public:
61 static void FreeStrBuf(char* str);
62
68 static void FreeBuf(void* data);
69
79 static void SetProxy(NIMProxyType type, const std::string& host, int port, const std::string& user, const std::string& password);
80
91 static void DetectProxy(NIMProxyType type,
92 const std::string& host,
93 int port,
94 const std::string& user,
95 const std::string& password,
96 const Global::DetectProxyCallback& callback);
97
104 static void SetExceptionReportCallback(const std::string& json_extension, const ExceptionCallback& cb);
105
115 static void GetSDKCachedFileInfoAsync(const std::string& login_id,
116 const std::string& file_type,
117 int64_t end_timestamp,
118 const std::string& json_extension,
119 const GetCachedFileInfoCallback& cb);
120
131 static void DeleteSDKCachedFileAsync(const std::string& login_id,
132 const std::string& file_type,
133 int64_t end_timestamp,
134 const std::string& json_extension,
135 const DeleteCachedFileCallback& cb);
136
144 static void SDKFeedbackAsync(const std::string& url, const std::string& json_extension, const SDKFeedbackCallback& cb);
145
151 static void RegSDKDBError(const SDKDBErrorCallback& cb);
152
159 static void UploadSDKLog(const std::string& feedback_message, const SDKFeedbackCallback& cb);
160};
161
162} // namespace nim
163
164#endif //_NIM_SDK_CPP_GLOBAL_H_
NIM SDK提供的一些全局接口
Definition: nim_cpp_global.h:23
namespace nim
NIMResCode
Definition: nim_chatroom_res_code_def.h:15
NIM 公共数据类型定义总的包含文件
NIMProxyType
Definition: nim_global_def.h:186
NIMSDKException
Definition: nim_global_def.h:66
NIMProxyDetectStep
Definition: nim_global_def.h:181
@ kNIMDBOperationInsert
写操作
Definition: nim_global_def.h:141
@ kNIMDBOperationDelete
删除操作
Definition: nim_global_def.h:147
@ kNIMDBOperationUpdate
更新操作
Definition: nim_global_def.h:145
@ kNIMDBOperationRead
读操作
Definition: nim_global_def.h:143
定义导出宏
Definition: nim_cpp_global.h:25
Definition: nim_cpp_global.h:31
DBOperation
Definition: nim_cpp_global.h:32