3#ifndef EILE_MIT_WEILE_JSON_UTILS_HPP
4#define EILE_MIT_WEILE_JSON_UTILS_HPP
8#include "rapidjson/writer.h"
9#include "rapidjson/document.h"
10#include "rapidjson/stringbuffer.h"
19 static std::string
ToString(
const rapidjson::Value* json) {
20 rapidjson::StringBuffer buffer;
22 rapidjson::Writer<rapidjson::StringBuffer> writer(buffer);
24 return buffer.GetString();
28 static rapidjson::Document*
CloneValue(
const rapidjson::Value& val) {
29 auto* state_json =
new rapidjson::Document(rapidjson::kObjectType);
30 state_json->CopyFrom(val, state_json->GetAllocator());
Helper functions for rapidjson elements.
Definition json_utils.hpp:17
static rapidjson::Document * CloneValue(const rapidjson::Value &val)
Definition json_utils.hpp:28
static std::string ToString(const rapidjson::Value *json)
Definition json_utils.hpp:19