#ifndef UTIL_H #define UTIL_H #include #include #include template T getJson(const Json::Value &root, const std::string &key); template T getJsonOrFail(const Json::Value &root, const std::string &key) { const auto members = root.getMemberNames(); if (std::find(members.begin(), members.end(), key) == members.end()) { throw std::runtime_error("Json key \"" + key + "\" not existing"); } return getJson(root, key); } std::string toHexString(uint64_t c); #endif