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:
Jonas Schnelli
2015-05-18 14:02:18 +02:00
parent 3df0411ad9
commit 9a8897f4ac
37 changed files with 213 additions and 2203 deletions

View File

@@ -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;
}

View File

@@ -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