Skip to content
Snippets Groups Projects
Commit 56442acc authored by Michael Cho's avatar Michael Cho Committed by Adrien Béraud
Browse files

value: fix build without jsoncpp

parent 41c9104b
No related branches found
No related tags found
No related merge requests found
...@@ -239,6 +239,21 @@ Value::toJson() const ...@@ -239,6 +239,21 @@ Value::toJson() const
return val; return val;
} }
uint64_t
unpackId(const Json::Value& json, const std::string& key) {
uint64_t ret = 0;
try {
const auto& t = json[key];
if (t.isString()) {
ret = std::stoull(t.asString());
} else {
ret = t.asLargestUInt();
}
} catch (...) {}
return ret;
}
#endif
bool bool
Value::checkSignature() Value::checkSignature()
{ {
...@@ -274,21 +289,6 @@ Value::decrypt(const crypto::PrivateKey& key) ...@@ -274,21 +289,6 @@ Value::decrypt(const crypto::PrivateKey& key)
return decryptedValue; return decryptedValue;
} }
uint64_t
unpackId(const Json::Value& json, const std::string& key) {
uint64_t ret = 0;
try {
const auto& t = json[key];
if (t.isString()) {
ret = std::stoull(t.asString());
} else {
ret = t.asLargestUInt();
}
} catch (...) {}
return ret;
}
#endif
bool bool
FieldValue::operator==(const FieldValue& vfd) const FieldValue::operator==(const FieldValue& vfd) const
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment