32 #ifndef LEDGER_CORE_RIPPLELIKEBLOCKPARSER_H 33 #define LEDGER_CORE_RIPPLELIKEBLOCKPARSER_H 35 #include <wallet/common/explorers/api/AbstractBlockParser.h> 36 #include "../RippleLikeBlockchainExplorer.h" 44 bool RawNumber(
const rapidjson::Reader::Ch *str, rapidjson::SizeType length,
bool copy) {
45 if (getLastKey() ==
"ledger_index") {
46 std::string number(str, length);
47 BigInt value = BigInt::fromString(number);
48 _block->height = value.toUint64();
53 bool String(
const rapidjson::Reader::Ch *str, rapidjson::SizeType length,
bool copy) {
54 std::string value = std::string(str, length);
55 if (getLastKey() ==
"ledger_hash") {
57 }
else if (getLastKey() ==
"close_time_human") {
58 _block->time = DateUtils::fromJSON(value);
64 std::string &getLastKey()
override {
68 std::string &_lastKey;
73 #endif //LEDGER_CORE_RIPPLELIKEBLOCKPARSER_H Definition: AbstractBlockParser.h:45
Definition: Account.cpp:8
Definition: RippleLikeBlockParser.h:40