Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

value: fix build without jsoncpp #613

Merged
merged 1 commit into from
May 25, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions src/value.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,21 @@ Value::toJson() const
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
Value::checkSignature()
{
Expand Down Expand Up @@ -274,21 +289,6 @@ Value::decrypt(const crypto::PrivateKey& key)
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
FieldValue::operator==(const FieldValue& vfd) const
{
Expand Down