Remove JSON Spirit wrapper, remove JSON Spirit leftovers
- implement find_value() function for UniValue - replace all Array/Value/Object types with UniValues, remove JSON Spirit to UniValue wrapper - remove JSON Spirit sources
This commit is contained in:
@@ -213,3 +213,15 @@ const char *uvTypeName(UniValue::VType t)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const UniValue& find_value( const UniValue& obj, const std::string& name)
|
||||
{
|
||||
for (unsigned int i = 0; i < obj.keys.size(); i++)
|
||||
{
|
||||
if( obj.keys[i] == name )
|
||||
{
|
||||
return obj.values[i];
|
||||
}
|
||||
}
|
||||
|
||||
return NullUniValue;
|
||||
}
|
||||
@@ -161,6 +161,7 @@ public:
|
||||
std::istringstream(getValStr()) >> ret;
|
||||
return ret;
|
||||
}
|
||||
friend const UniValue& find_value( const UniValue& obj, const std::string& name);
|
||||
};
|
||||
|
||||
//
|
||||
@@ -248,5 +249,8 @@ extern enum jtokentype getJsonToken(std::string& tokenVal,
|
||||
extern const char *uvTypeName(UniValue::VType t);
|
||||
|
||||
extern const UniValue NullUniValue;
|
||||
|
||||
const UniValue& find_value( const UniValue& obj, const std::string& name);
|
||||
|
||||
#endif // BITCOIN_UNIVALUE_UNIVALUE_H
|
||||
|
||||
|
||||
Reference in New Issue
Block a user