diff --git a/include/simdjson/parsedjson.h b/include/simdjson/parsedjson.h index 99053b067..3dc30fe8b 100644 --- a/include/simdjson/parsedjson.h +++ b/include/simdjson/parsedjson.h @@ -154,6 +154,12 @@ public: bool is_double() const; + bool is_true() const; + + bool is_false() const; + + bool is_null() const; + static bool is_object_or_array(uint8_t type); // when at {, go one level deep, looking for a given key diff --git a/src/parsedjsoniterator.cpp b/src/parsedjsoniterator.cpp index c2bd7179b..b8cea9fe4 100644 --- a/src/parsedjsoniterator.cpp +++ b/src/parsedjsoniterator.cpp @@ -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 == '{')); }