NIM SDK API  9.0.0
nim_doc_trans_helper.h
Go to the documentation of this file.
1 
7 #ifndef _NIM_SDK_CPP_DOC_TRANS_HELPER_H_
8 #define _NIM_SDK_CPP_DOC_TRANS_HELPER_H_
9 
10 #include <functional>
11 #include <list>
12 #include <string>
13 #include "nim_define_include.h"
15 #include "nim_wrapper_util/nim_json_util.h"
20 namespace nim {
22 struct NIM_SDK_CPPWRAPPER_DLL_API PictureInfo {
23  NIMDocTranscodingQuality quality_;
24  int width_;
25  int height_;
26  int64_t size_;
27  PictureInfo()
28  : quality_(kNIMDocTranscodingQualityHigh)
29  , width_(0)
30  , height_(0)
31  , size_(0) {}
32 };
33 
35 struct NIM_SDK_CPPWRAPPER_DLL_API DocTransInfo {
36  std::string id_;
37  std::string name_;
38  NIMDocTranscodingFileType source_type_;
39  int64_t size_;
40  NIMDocTranscodingImageType pic_type_;
41  NIMDocTranscodingState state_;
42  std::string url_prefix_;
43  int page_num_;
44  std::string ext_;
45  std::list<PictureInfo> pic_info_;
47  std::string upload_file_path;
48  NIMDocContinueUploadState continue_upload_state_;
49  DocTransInfo()
50  : source_type_(kNIMDocTranscodingFileTypePPT)
51  , size_(0)
52  , pic_type_(kNIMDocTranscodingImageTypeJPG)
53  , state_(kNIMDocTranscodingStatePreparing)
54  , page_num_(0)
55  , continue_upload_state_(kNIMDocContinueUploadNone) {}
56 };
57 
64 NIM_SDK_CPPWRAPPER_DLL_API bool ParseDocTransInfo(const std::string& json, DocTransInfo& info);
65 
72 NIM_SDK_CPPWRAPPER_DLL_API int32_t ParseDocTransInfos(const std::string& json, std::list<DocTransInfo>& info_list);
73 
74 } // namespace nim
75 
76 #endif //_NIM_SDK_CPP_DOC_TRANS_HELPER_H_
nim::DocTransInfo::continue_upload_state_
NIMDocContinueUploadState continue_upload_state_
Definition: nim_doc_trans_helper.h:48
nim::DocTransInfo::page_num_
int page_num_
Definition: nim_doc_trans_helper.h:43
nim::DocTransInfo::url_prefix_
std::string url_prefix_
Definition: nim_doc_trans_helper.h:42
nim::PictureInfo
文档传输的图片信息
Definition: nim_doc_trans_helper.h:22
nim::ParseDocTransInfos
NIM_SDK_CPPWRAPPER_DLL_API int32_t ParseDocTransInfos(const std::string &json, std::list< DocTransInfo > &info_list)
解析一组文档传输信息
nim::DocTransInfo::name_
std::string name_
Definition: nim_doc_trans_helper.h:37
nim::DocTransInfo::upload_file_path
std::string upload_file_path
Definition: nim_doc_trans_helper.h:47
nim::PictureInfo::quality_
NIMDocTranscodingQuality quality_
Definition: nim_doc_trans_helper.h:23
nim::PictureInfo::size_
int64_t size_
Definition: nim_doc_trans_helper.h:26
nim::DocTransInfo
文档传输信息
Definition: nim_doc_trans_helper.h:35
nim::DocTransInfo::pic_type_
NIMDocTranscodingImageType pic_type_
Definition: nim_doc_trans_helper.h:40
nim
namespace nim
nim::PictureInfo::width_
int width_
Definition: nim_doc_trans_helper.h:24
nim::DocTransInfo::pic_info_
std::list< PictureInfo > pic_info_
Definition: nim_doc_trans_helper.h:45
nim::PictureInfo::height_
int height_
Definition: nim_doc_trans_helper.h:25
nim::ParseDocTransInfo
NIM_SDK_CPPWRAPPER_DLL_API bool ParseDocTransInfo(const std::string &json, DocTransInfo &info)
解析文档传输信息
nim::DocTransInfo::id_
std::string id_
Definition: nim_doc_trans_helper.h:36
nim::DocTransInfo::source_type_
NIMDocTranscodingFileType source_type_
Definition: nim_doc_trans_helper.h:38
nim::DocTransInfo::size_
int64_t size_
Definition: nim_doc_trans_helper.h:39
nim::DocTransInfo::ext_
std::string ext_
Definition: nim_doc_trans_helper.h:44
nim_sdk_cpp_wrapper.h
定义导出宏
nim::DocTransInfo::state_
NIMDocTranscodingState state_
Definition: nim_doc_trans_helper.h:41