27 #include <rapidjson/document.h>
28 #include <rapidjson/istreamwrapper.h>
30 #include "ParserWrapper.h"
35 inline T parse(
const std::string& json) {
36 rapidjson::Document doc;
37 doc.Parse(json.c_str());
39 if (doc.IsObject() || doc.IsArray()) {
40 from_json(doc, result);
46 inline T parse(std::stringstream& json_stream,
bool& res) {
48 rapidjson::Document doc;
49 rapidjson::IStreamWrapper stream(json_stream);
50 doc.ParseStream(stream);
52 if (doc.IsObject() || doc.IsArray()) {
53 from_json(doc, result);
60 inline T parse(std::stringstream& json_stream) {
62 return parse<T>(json_stream, res);
66 inline T parse(
const std::shared_ptr<std::vector<unsigned char>>& json_bytes) {
67 rapidjson::Document doc;
68 doc.Parse(
reinterpret_cast<char*
>(json_bytes->data()), json_bytes->size());
70 if (doc.IsObject() || doc.IsArray()) {
71 from_json(doc, result);
Rules all the other namespaces.
Definition: AppleSignInProperties.h:24