31 #ifndef LEDGER_CORE_JSONUTILS_H 32 #define LEDGER_CORE_JSONUTILS_H 34 #include <rapidjson/reader.h> 36 #include <wallet/common/explorers/LedgerApiParser.hpp> 43 template <
typename Parser>
44 static std::shared_ptr<typename Parser::Result> parse(
const std::string&
json) {
46 parser.attach(
"", 200);
47 rapidjson::Reader reader;
48 rapidjson::StringStream is(json.data());
49 reader.Parse<rapidjson::ParseFlag::kParseNumbersAsStringsFlag>(is, parser);
50 auto result = parser.build();
51 if (result.isLeft()) {
52 throw result.getLeft();
54 return result.getRight();
61 #endif //LEDGER_CORE_JSONUTILS_H a class to store JSON values
Definition: json.hpp:231
Definition: Account.cpp:8
Definition: LedgerApiParser.hpp:42
Definition: JSONUtils.h:41