jsonBuilder.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #ifndef _JSONBUILDER_H_
  2. #define _JSONBUILDER_H_
  3. #include <rapidjson/document.h>
  4. #include "jsonCommon.h"
  5. namespace YA
  6. {
  7. class jsonBuilder
  8. {
  9. private:
  10. /**
  11. * @brief
  12. 加上版本信息函数。
  13. * @param [out] rapidjson::Value& root 根jason对象\n
  14. * @param [out] rapidjson::Document::AllocatorType& allocator 分配器\n
  15. * @return 无\n
  16. * @note
  17. * @warning
  18. * @bug
  19. */
  20. void __AddVersion( rapidjson::Value& root, rapidjson::Document::AllocatorType& allocator );
  21. public:
  22. jsonBuilder();
  23. virtual ~jsonBuilder();
  24. /**
  25. * @brief
  26. 生成登录jason函数。
  27. * @param [in] const _JS_LOGIN_& Login 登录参数\n
  28. * @return 如果成功返回生成的json字符串,否则返回空字符串\n
  29. * @note
  30. * @warning
  31. * @bug
  32. */
  33. std::string BuildLogin( const _JS_LOGIN_& Login );
  34. /**
  35. * @brief
  36. 解析呼叫结构体函数。
  37. * @param [in] const _JS_LOGIN_& Login 登录参数\n
  38. * @return 如果成功返回生成的jason字符串,否则返回空字符串\n
  39. * @note
  40. * @warning
  41. * @bug
  42. */
  43. bool ParseCall_Card_Req( const std::string& JasonText, _JS_CALL_CARD_REQ_& CallCardReq, std::string& Error );
  44. };
  45. }
  46. #endif /* _JSONBUILDER_H_ */