2021-10-11 22:05:45 +08:00
|
|
|
//
|
|
|
|
// Created by YuhangQ on 2021/10/9.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef INVODB_JSON_H
|
|
|
|
#define INVODB_JSON_H
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include "rapidjson/document.h"
|
2021-10-23 16:28:57 +08:00
|
|
|
#include "rapidjson/writer.h"
|
|
|
|
#include "rapidjson/stringbuffer.h"
|
2021-10-11 22:05:45 +08:00
|
|
|
|
|
|
|
using namespace rapidjson;
|
|
|
|
|
|
|
|
class JSON : public Document {
|
2021-10-23 16:28:57 +08:00
|
|
|
public:
|
|
|
|
JSON(std::string json): Document() { this->Parse(json.c_str()); }
|
|
|
|
JSON(const char *json): Document() { this->Parse(json); }
|
2021-10-11 22:05:45 +08:00
|
|
|
|
2021-10-23 16:28:57 +08:00
|
|
|
std::string ToString();
|
|
|
|
private:
|
2021-10-11 22:05:45 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif //INVODB_JSON_H
|