NIM SDK API  9.0.0
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>
12 #include "nim_define_include.h"
18 namespace nim {
19 
23 class NIM_SDK_CPPWRAPPER_DLL_API Global {
24 public:
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 {
32  enum DBOperation {
33  kNIMDBOperationInsert = 0x0001,
34  kNIMDBOperationRead = 0x0002,
35  kNIMDBOperationUpdate = 0x0004,
36  kNIMDBOperationDelete = 0x0008,
37  };
38  std::string db_name_;
39  int error_code_;
40  int operation_;
41  std::string description_;
42  std::string attach_;
43  };
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;
50 
51 public:
57  static void FreeStrBuf(char* str);
58 
64  static void FreeBuf(void* data);
65 
75  static void SetProxy(NIMProxyType type, const std::string& host, int port, const std::string& user, const std::string& password);
76 
87  static void DetectProxy(NIMProxyType type,
88  const std::string& host,
89  int port,
90  const std::string& user,
91  const std::string& password,
92  const Global::DetectProxyCallback& callback);
93 
100  static void SetExceptionReportCallback(const std::string& json_extension, const ExceptionCallback& cb);
101 
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);
116 
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);
132 
140  static void SDKFeedbackAsync(const std::string& url, const std::string& json_extension, const SDKFeedbackCallback& cb);
141 
147  static void RegSDKDBError(const SDKDBErrorCallback& cb);
148 
155  static void UploadSDKLog(const std::string& feedback_message, const SDKFeedbackCallback& cb);
156 };
157 
158 } // namespace nim
159 
160 #endif //_NIM_SDK_CPP_GLOBAL_H_
nim::Global::CachedFileInfo
Definition: nim_cpp_global.h:25
nim::Global::SDKDBErrorInfo::DBOperation
DBOperation
Definition: nim_cpp_global.h:32
nim::Global
NIM SDK提供的一些全局接口
Definition: nim_cpp_global.h:23
nim
namespace nim
nim::Global::SDKDBErrorInfo
Definition: nim_cpp_global.h:31
nim_sdk_cpp_wrapper.h
定义导出宏