12#include "rapidjson/document.h"
13#include "rapidjson/prettywriter.h"
14#include "rapidjson/stringbuffer.h"
34#define JobjectType rapidjson::kObjectType
35#define JarrayType rapidjson::kArrayType
36#define Get_Jallocator Json::AbacusJson::allocator()
37#define Set_JString(str) Json::jsonValue().SetString(str.c_str(),str.length(),Get_Jallocator)
40#define JaddStringV(str,val) AddMember(str, Set_JString(val), Get_Jallocator)
41#define JaddStringK(str,val) AddMember(Set_JString(str), val, Get_Jallocator)
42#define JaddStringKV(str,val) AddMember(Set_JString(str), Set_JString(val), Get_Jallocator)
43#define JaddNormal(str,val) AddMember(str, val, Get_Jallocator)
44#define JPushBack(val) PushBack(val, Get_Jallocator)
45#define JPushBackString(val) PushBack(Set_JString(val), Get_Jallocator)
54using jsonValue = rapidjson::Value;
63 static void write_to_json(std::string filename);
65 static rapidjson::Document::AllocatorType& allocator(){
66 return doc.GetAllocator();
97 static void add_json(std::vector<jsonKeyNode> keys,
const T& value,
bool IsArray)
103 rapidjson::Value val(value);
104 add_nested_member(keys.begin(), keys.end(), val, doc, doc.GetAllocator(),IsArray);
111 static rapidjson::Document doc;
113 static void add_nested_member(std::vector<jsonKeyNode>::iterator begin,
114 std::vector<jsonKeyNode>::iterator end,
115 rapidjson::Value& val,
116 rapidjson::Value& parent,
117 rapidjson::Document::AllocatorType& allocator,
123void AbacusJson::add_json(std::vector<jsonKeyNode> keys,
const std::string& value,
bool IsArray);
126void AbacusJson::add_json(std::vector<jsonKeyNode> keys,
const rapidjson::Value& value,
bool IsArray);
#define T
Definition exp.cpp:237
In this part of the code to complete the general_info part of the json tree.
Definition abacusjson.cpp:9