7 #ifndef _NIM_SDK_CPP_GLOBAL_H_
8 #define _NIM_SDK_CPP_GLOBAL_H_
12 #include "nim_define_include.h"
23 class NIM_SDK_CPPWRAPPER_DLL_API
Global {
26 std::string file_type_;
27 std::string file_path_;
29 int64_t file_total_size_;
33 kNIMDBOperationInsert = 0x0001,
34 kNIMDBOperationRead = 0x0002,
35 kNIMDBOperationUpdate = 0x0004,
36 kNIMDBOperationDelete = 0x0008,
41 std::string description_;
44 typedef std::function<void(
bool conncet, NIMProxyDetectStep step,
const std::string& json_extension)> DetectProxyCallback;
45 typedef std::function<void(NIMSDKException exception,
const std::string& log)> ExceptionCallback;
46 typedef std::function<void(NIMResCode rescode,
const CachedFileInfo& info)> GetCachedFileInfoCallback;
47 typedef std::function<void(NIMResCode rescode)> DeleteCachedFileCallback;
48 typedef DeleteCachedFileCallback SDKFeedbackCallback;
49 typedef std::function<void(
const SDKDBErrorInfo& error_info)> SDKDBErrorCallback;
57 static void FreeStrBuf(
char* str);
64 static void FreeBuf(
void* data);
75 static void SetProxy(NIMProxyType type,
const std::string& host,
int port,
const std::string& user,
const std::string& password);
87 static void DetectProxy(NIMProxyType type,
88 const std::string& host,
90 const std::string& user,
91 const std::string& password,
92 const Global::DetectProxyCallback& callback);
100 static void SetExceptionReportCallback(
const std::string& json_extension,
const ExceptionCallback& cb);
111 static void GetSDKCachedFileInfoAsync(
const std::string& login_id,
112 const std::string& file_type,
113 int64_t end_timestamp,
114 const std::string& json_extension,
115 const GetCachedFileInfoCallback& cb);
127 static void DeleteSDKCachedFileAsync(
const std::string& login_id,
128 const std::string& file_type,
129 int64_t end_timestamp,
130 const std::string& json_extension,
131 const DeleteCachedFileCallback& cb);
140 static void SDKFeedbackAsync(
const std::string& url,
const std::string& json_extension,
const SDKFeedbackCallback& cb);
147 static void RegSDKDBError(
const SDKDBErrorCallback& cb);
155 static void UploadSDKLog(
const std::string& feedback_message,
const SDKFeedbackCallback& cb);
160 #endif //_NIM_SDK_CPP_GLOBAL_H_