diff options
Diffstat (limited to 'src/univalue/include')
-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__ |