EasyJson.hpp
1 //
2 // Created by xiong on 2022/6/9.
3 //
4 
5 #ifndef EMX_EasyJson_HPP
6 #define EMX_EasyJson_HPP
7 
8 #include "core/EmxTypeDef.hpp"
9 #include "json/json.h"
10 
11 namespace Emx {
17  class EasyJson {
18  public:
25  static ErrCodeE Load(const char *path, Json::Value &json);
26 
33  static ErrCodeE Parse(const char *data, Json::Value &json);
34 
42  static ErrCodeE Parse(const char *data, int size, Json::Value &json);
43 
50  static ErrCodeE Parse(const std::string &data, Json::Value &json);
51 
58  static ErrCodeE Serialize(const Json::Value &json, std::string &jsonStr);
59  };
61 }
62 
63 #endif //EMX_EasyJson_HPP
Json相关操作
Definition: EasyJson.hpp:17
static ErrCodeE Serialize(const Json::Value &json, std::string &jsonStr)
序列化json,转换为字符串
static ErrCodeE Parse(const std::string &data, Json::Value &json)
解析json数据
static ErrCodeE Parse(const char *data, Json::Value &json)
解析json数据
static ErrCodeE Parse(const char *data, int size, Json::Value &json)
解析json数据
static ErrCodeE Load(const char *path, Json::Value &json)
从文件中加载json数据
ErrCodeE
错误码定义
Definition: EmxTypeDef.hpp:29
Definition: EmxGpio.hpp:10