Add predicates to ParsedJson::iterator (#153)

This commit is contained in:
saka1
2019-05-08 03:11:33 +09:00
committed by Daniel Lemire
parent 7c8404eaf9
commit 719dff1312
2 changed files with 18 additions and 0 deletions
+12
View File
@@ -161,6 +161,18 @@ bool ParsedJson::iterator::is_double() const {
return get_type() == 'd';
}
bool ParsedJson::iterator::is_true() const {
return get_type() == 't';
}
bool ParsedJson::iterator::is_false() const {
return get_type() == 'f';
}
bool ParsedJson::iterator::is_null() const {
return get_type() == 'n';
}
bool ParsedJson::iterator::is_object_or_array(uint8_t type) {
return (type == '[' || (type == '{'));
}