Create pools directly from JSON objects.
This commit is contained in:
parent
3a0fdcac6f
commit
bdff4064a2
9 changed files with 76 additions and 47 deletions
|
@ -36,3 +36,14 @@ bool xmrig::Json::getBool(const rapidjson::Value &obj, const char *key, bool def
|
|||
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
|
||||
const char *xmrig::Json::getString(const rapidjson::Value &obj, const char *key, const char *defaultValue)
|
||||
{
|
||||
auto i = obj.FindMember(key);
|
||||
if (i != obj.MemberEnd() && i->value.IsString()) {
|
||||
return i->value.GetString();
|
||||
}
|
||||
|
||||
return defaultValue;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue