aboutsummaryrefslogtreecommitdiff
path: root/src/univalue/include/univalue.h
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2015-12-02 12:28:14 +0100
committerMarcoFalke <falke.marco@gmail.com>2015-12-02 12:28:48 +0100
commitfad4ea836dc7cd1bb13c7394a6fadff419e4b026 (patch)
treeff7f84f4820a67a433c25e42b7914f3fced26193 /src/univalue/include/univalue.h
parent1b0241fcec3e00d13658090e26cfa1f05133116e (diff)
parent982709199f1b4e9e35211c419a81938f9f1dd4ed (diff)
Merge commit '982709199f1b4e9e35211c419a81938f9f1dd4ed' into bitcoin
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__