aboutsummaryrefslogtreecommitdiff
path: root/src/univalue/include/univalue.h
diff options
context:
space:
mode:
authorLuke Dashjr <luke-jr+git@utopios.org>2016-01-15 05:17:15 +0000
committerLuke Dashjr <luke-jr+git@utopios.org>2016-01-15 05:17:15 +0000
commit5bc4fb7b602c420be1c746442edad6b2d8e333ab (patch)
tree32ce1458f7fafdf4f9a1dcb09091f1a6de416625 /src/univalue/include/univalue.h
parente8600c924d58f3ef0450fc269998452e5b17aecb (diff)
parentc079d79c9a9c726fff367abc2d21c528e37275b9 (diff)
Merge branch 'master' into 20150703_banlist_updates
Diffstat (limited to 'src/univalue/include/univalue.h')
-rw-r--r--src/univalue/include/univalue.h35
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__