diff options
author | Luke Dashjr <luke-jr+git@utopios.org> | 2016-01-15 05:17:15 +0000 |
---|---|---|
committer | Luke Dashjr <luke-jr+git@utopios.org> | 2016-01-15 05:17:15 +0000 |
commit | 5bc4fb7b602c420be1c746442edad6b2d8e333ab (patch) | |
tree | 32ce1458f7fafdf4f9a1dcb09091f1a6de416625 /src/univalue/include/univalue.h | |
parent | e8600c924d58f3ef0450fc269998452e5b17aecb (diff) | |
parent | c079d79c9a9c726fff367abc2d21c528e37275b9 (diff) |
Merge branch 'master' into 20150703_banlist_updates
Diffstat (limited to 'src/univalue/include/univalue.h')
-rw-r--r-- | src/univalue/include/univalue.h | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/src/univalue/include/univalue.h b/src/univalue/include/univalue.h index ac05116011..8428b1c683 100644 --- a/src/univalue/include/univalue.h +++ b/src/univalue/include/univalue.h @@ -243,8 +243,41 @@ extern enum jtokentype getJsonToken(std::string& tokenVal, unsigned int& consumed, const char *raw); extern const char *uvTypeName(UniValue::VType t); +static inline bool jsonTokenIsValue(enum jtokentype jtt) +{ + switch (jtt) { + case JTOK_KW_NULL: + case JTOK_KW_TRUE: + case JTOK_KW_FALSE: + case JTOK_NUMBER: + case JTOK_STRING: + return true; + + default: + return false; + } + + // not reached +} + +static inline bool json_isspace(int ch) +{ + switch (ch) { + case 0x20: + case 0x09: + case 0x0a: + case 0x0d: + return true; + + default: + return false; + } + + // not reached +} + extern const UniValue NullUniValue; const UniValue& find_value( const UniValue& obj, const std::string& name); -#endif // __UNIVALUE_H__
\ No newline at end of file +#endif // __UNIVALUE_H__ |