diff options
| author | Jonas Schnelli <[email protected]> | 2015-05-18 14:02:18 +0200 |
|---|---|---|
| committer | Jonas Schnelli <[email protected]> | 2015-06-04 09:16:21 +0200 |
| commit | 9a8897f4ac992741e153d88b54bd2cde877c713d (patch) | |
| tree | e827981679708bae6bef1516d69efda3524b719f /src/univalue/univalue.cpp | |
| parent | remove JSON Spirit UniValue wrapper (diff) | |
| download | discoin-9a8897f4ac992741e153d88b54bd2cde877c713d.tar.xz discoin-9a8897f4ac992741e153d88b54bd2cde877c713d.zip | |
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
Diffstat (limited to 'src/univalue/univalue.cpp')
| -rw-r--r-- | src/univalue/univalue.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/univalue/univalue.cpp b/src/univalue/univalue.cpp index 994d93113..e8fc51343 100644 --- a/src/univalue/univalue.cpp +++ b/src/univalue/univalue.cpp @@ -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; +}
\ No newline at end of file |