|
@@ -2149,3 +2149,103 @@ void cJSON_Minify(char *json)
|
|
|
/* and null-terminate. */
|
|
|
*into = '\0';
|
|
|
}
|
|
|
+
|
|
|
+extern cjbool cJSON_IsInvalid(const cJSON * const item)
|
|
|
+{
|
|
|
+ if (item == NULL)
|
|
|
+ {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ return (item->type & 0xFF) == cJSON_Invalid;
|
|
|
+}
|
|
|
+
|
|
|
+extern cjbool cJSON_IsFalse(const cJSON * const item)
|
|
|
+{
|
|
|
+ if (item == NULL)
|
|
|
+ {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ return (item->type & 0xFF) == cJSON_False;
|
|
|
+}
|
|
|
+
|
|
|
+extern cjbool cJSON_IsTrue(const cJSON * const item)
|
|
|
+{
|
|
|
+ if (item == NULL)
|
|
|
+ {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ return (item->type & 0xff) == cJSON_True;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+extern cjbool cJSON_IsBool(const cJSON * const item)
|
|
|
+{
|
|
|
+ if (item == NULL)
|
|
|
+ {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ return (item->type & (cJSON_True | cJSON_False)) != 0;
|
|
|
+}
|
|
|
+extern cjbool cJSON_IsNull(const cJSON * const item)
|
|
|
+{
|
|
|
+ if (item == NULL)
|
|
|
+ {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ return (item->type & 0xFF) == cJSON_NULL;
|
|
|
+}
|
|
|
+
|
|
|
+extern cjbool cJSON_IsNumber(const cJSON * const item)
|
|
|
+{
|
|
|
+ if (item == NULL)
|
|
|
+ {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ return (item->type & 0xFF) == cJSON_Number;
|
|
|
+}
|
|
|
+
|
|
|
+extern cjbool cJSON_IsString(const cJSON * const item)
|
|
|
+{
|
|
|
+ if (item == NULL)
|
|
|
+ {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ return (item->type & 0xFF) == cJSON_String;
|
|
|
+}
|
|
|
+
|
|
|
+extern cjbool cJSON_IsArray(const cJSON * const item)
|
|
|
+{
|
|
|
+ if (item == NULL)
|
|
|
+ {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ return (item->type & 0xFF) == cJSON_Array;
|
|
|
+}
|
|
|
+
|
|
|
+extern cjbool cJSON_IsObject(const cJSON * const item)
|
|
|
+{
|
|
|
+ if (item == NULL)
|
|
|
+ {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ return (item->type & 0xFF) == cJSON_Object;
|
|
|
+}
|
|
|
+
|
|
|
+extern cjbool cJSON_IsRaw(const cJSON * const item)
|
|
|
+{
|
|
|
+ if (item == NULL)
|
|
|
+ {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ return (item->type & 0xFF) == cJSON_Raw;
|
|
|
+}
|