NIM SDK API  9.0.0
nim_robot_helper.h
Go to the documentation of this file.
1 
7 #ifndef _NIM_SDK_CPP_ROBOT_HELPER_H_
8 #define _NIM_SDK_CPP_ROBOT_HELPER_H_
9 
10 #include <assert.h>
11 #include <list>
12 #include <string>
13 #include "nim_define_include.h"
15 #include "nim_wrapper_util/nim_json_util.h"
16 #include "public_defines.h"
21 namespace nim {
23 struct NIM_SDK_CPPWRAPPER_DLL_API RobotInfo {
24 public:
26  void SetAccid(const std::string& accid) { robot_info_[kNIMRobotInfoKeyAccid] = accid; }
27 
29  std::string GetAccid() const { return robot_info_[kNIMRobotInfoKeyAccid].asString(); }
30 
32  void SetName(const std::string& name) { robot_info_[kNIMRobotInfoKeyName] = name; }
33 
35  std::string GetName() const { return robot_info_[kNIMRobotInfoKeyName].asString(); }
36 
38  void SetIcon(const std::string& icon) { robot_info_[kNIMRobotInfoKeyIcon] = icon; }
39 
41  std::string GetIcon() const { return robot_info_[kNIMRobotInfoKeyIcon].asString(); }
42 
44  void SetIntro(const std::string& intro) { robot_info_[kNIMRobotInfoKeyIntro] = intro; }
45 
47  std::string GetIntro() const { return robot_info_[kNIMRobotInfoKeyIntro].asString(); }
48 
50  void SetRobotID(const std::string& id) { robot_info_[kNIMRobotInfoKeyRobotId] = id; }
51 
53  std::string GetRobotID() const { return robot_info_[kNIMRobotInfoKeyRobotId].asString(); }
54 
56  void SetCreateTime(const uint64_t time) { robot_info_[kNIMRobotInfoKeyCreateTime] = time; }
57 
59  uint64_t GetCreateTime() const { return robot_info_[kNIMRobotInfoKeyCreateTime].asUInt64(); }
60 
62  void SetUpdateTime(const uint64_t time) { robot_info_[kNIMRobotInfoKeyUpdateTime] = time; }
63 
65  uint64_t GetUpdateTime() const { return robot_info_[kNIMRobotInfoKeyUpdateTime].asUInt64(); }
66 
67 private:
68  nim_cpp_wrapper_util::Json::Value robot_info_;
69 };
70 
71 typedef std::list<RobotInfo> RobotInfos;
72 
79 NIM_SDK_CPPWRAPPER_DLL_API bool ParseRobotInfosStringToRobotInfos(const std::string& infos_json, RobotInfos& infos);
80 
87 NIM_SDK_CPPWRAPPER_DLL_API bool ParseRobotInfoStringToRobotInfo(const std::string& info_json, RobotInfo& info);
88 
89 } // namespace nim
90 
91 #endif //_NIM_SDK_CPP_ROBOT_HELPER_H_
nim::RobotInfo::GetAccid
std::string GetAccid() const
Definition: nim_robot_helper.h:29
nim::RobotInfo
机器人信息
Definition: nim_robot_helper.h:23
nim::RobotInfo::GetRobotID
std::string GetRobotID() const
Definition: nim_robot_helper.h:53
nim::RobotInfo::SetIcon
void SetIcon(const std::string &icon)
Definition: nim_robot_helper.h:38
nim::RobotInfo::SetName
void SetName(const std::string &name)
Definition: nim_robot_helper.h:32
nim::RobotInfo::SetRobotID
void SetRobotID(const std::string &id)
Definition: nim_robot_helper.h:50
nim::RobotInfo::SetIntro
void SetIntro(const std::string &intro)
Definition: nim_robot_helper.h:44
nim::RobotInfo::SetCreateTime
void SetCreateTime(const uint64_t time)
Definition: nim_robot_helper.h:56
nim
namespace nim
nim::RobotInfo::SetUpdateTime
void SetUpdateTime(const uint64_t time)
Definition: nim_robot_helper.h:62
nim::ParseRobotInfosStringToRobotInfos
NIM_SDK_CPPWRAPPER_DLL_API bool ParseRobotInfosStringToRobotInfos(const std::string &infos_json, RobotInfos &infos)
解析机器人信息
nim::RobotInfo::GetCreateTime
uint64_t GetCreateTime() const
Definition: nim_robot_helper.h:59
nim::RobotInfo::GetName
std::string GetName() const
Definition: nim_robot_helper.h:35
nim::RobotInfo::SetAccid
void SetAccid(const std::string &accid)
Definition: nim_robot_helper.h:26
nim::RobotInfo::GetUpdateTime
uint64_t GetUpdateTime() const
Definition: nim_robot_helper.h:65
nim::ParseRobotInfoStringToRobotInfo
NIM_SDK_CPPWRAPPER_DLL_API bool ParseRobotInfoStringToRobotInfo(const std::string &info_json, RobotInfo &info)
解析机器人信息
nim::RobotInfo::GetIcon
std::string GetIcon() const
Definition: nim_robot_helper.h:41
nim::RobotInfo::GetIntro
std::string GetIntro() const
Definition: nim_robot_helper.h:47
nim_sdk_cpp_wrapper.h
定义导出宏