NIM PC Cross Platform SDK
载入中...
搜索中...
未找到
nim_nos_helper.h
浏览该文件的文档.
1
7#ifndef _NIM_SDK_CPP_NOS_HELPER_H_
8#define _NIM_SDK_CPP_NOS_HELPER_H_
9
10#include <functional>
11#include <list>
12#include <map>
13#include <string>
15#include "nim_define_include.h"
20namespace nim {
21
31 void AddTag(const std::string& tag, int32_t survival_time) {
32 tag_list_[tag] = ((survival_time == 0) ? (0) : (survival_time > kMINSURVIVALTIME ? survival_time : kMINSURVIVALTIME));
33 }
38 void RemoveTag(const std::string& tag) { tag_list_.erase(tag); }
42 std::map<std::string, int32_t> GetTagList() const { return tag_list_; }
47 void SetGetExtension(const std::string& json_extension) { json_extension_ = json_extension; }
51 std::string GetExtension() const { return json_extension_; }
52
54 static const int32_t kMINSURVIVALTIME;
56 std::map<std::string, int32_t> tag_list_;
58 std::string json_extension_;
59};
60
66 std::list<std::string> success_req_tags_;
68 std::map<std::string, int> failure_req_tags_;
70 std::list<std::string> ignore_req_tags_;
71 void FromJsonString(const std::string& json_data);
72};
73
77 std::string url_;
79 std::string res_id_;
81 std::string call_id_;
82
85};
86
90 std::string file_path_;
92 std::string call_id_;
94 std::string res_id_;
95
98};
99
103 std::string res_id_;
104
107};
108
116NIM_SDK_CPPWRAPPER_DLL_API bool ParseUploadResult(const std::string& url, const std::string& json, UploadMediaResult& res);
117
127NIM_SDK_CPPWRAPPER_DLL_API bool ParseDownloadResult(const std::string& file_path,
128 const std::string& call_id,
129 const std::string& res_id,
130 DownloadMediaResult& res);
131
138NIM_SDK_CPPWRAPPER_DLL_API bool ParseProgressData(const std::string& json, ProgressData& res);
139
140} // namespace nim
141
142#endif //_NIM_SDK_CPP_NOS_HELPER_H_
namespace nim
bool ParseDownloadResult(const std::string &file_path, const std::string &call_id, const std::string &res_id, DownloadMediaResult &res)
解析NOS上传过程数据
Definition: nim_nos_helper.cpp:57
bool ParseUploadResult(const std::string &url, const std::string &json, UploadMediaResult &res)
解析NOS上传结果
Definition: nim_nos_helper.cpp:44
bool ParseProgressData(const std::string &json, ProgressData &res)
解析NOS上传过程数据
Definition: nim_nos_helper.cpp:64
NIM 公共数据类型定义总的包含文件
NIMNosInitConfigResultType
Definition: nim_nos_def.h:16
定义导出宏
#define NIM_SDK_CPPWRAPPER_DLL_API
Definition: nim_sdk_cpp_wrapper.h:38
下载完成的结果
Definition: nim_nos_helper.h:88
std::string call_id_
请求者id
Definition: nim_nos_helper.h:92
std::string file_path_
本地绝对路径
Definition: nim_nos_helper.h:90
DownloadMediaResult()
Definition: nim_nos_helper.h:97
std::string res_id_
资源id
Definition: nim_nos_helper.h:94
初始化nos参数
Definition: nim_nos_helper.h:23
std::map< std::string, int32_t > GetTagList() const
Definition: nim_nos_helper.h:42
InitNosConfigParam()
Definition: nim_nos_helper.h:25
void SetGetExtension(const std::string &json_extension)
Definition: nim_nos_helper.h:47
static const int32_t kMINSURVIVALTIME
int32_t 资源生命周期 最小取值
Definition: nim_nos_helper.h:54
std::string json_extension_
Json Value 扩展数据
Definition: nim_nos_helper.h:58
void RemoveTag(const std::string &tag)
Definition: nim_nos_helper.h:38
std::map< std::string, int32_t > tag_list_
std::map<std::string, uint64_t> 场景标签信息列表
Definition: nim_nos_helper.h:56
std::string GetExtension() const
Definition: nim_nos_helper.h:51
void AddTag(const std::string &tag, int32_t survival_time)
Definition: nim_nos_helper.h:31
初始化结果
Definition: nim_nos_helper.h:62
std::map< std::string, int > failure_req_tags_
map 初始化失败的tag列表
Definition: nim_nos_helper.h:68
NIMNosInitConfigResultType result_
enum 初始化结果
Definition: nim_nos_helper.h:64
std::list< std::string > ignore_req_tags_
list 不需要重新初始化tag列表
Definition: nim_nos_helper.h:70
std::list< std::string > success_req_tags_
list 初始化成功的tag列表
Definition: nim_nos_helper.h:66
传输过程中的数据
Definition: nim_nos_helper.h:101
std::string res_id_
资源id
Definition: nim_nos_helper.h:103
ProgressData()
Definition: nim_nos_helper.h:106
上传完成的结果
Definition: nim_nos_helper.h:75
UploadMediaResult()
Definition: nim_nos_helper.h:84
std::string url_
上传地址
Definition: nim_nos_helper.h:77
std::string res_id_
资源id
Definition: nim_nos_helper.h:79
std::string call_id_
请求者id
Definition: nim_nos_helper.h:81