mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-28 19:41:16 +00:00
util: json: Add virJSONValueIsObject
Allows testing whether a virJSONValue is an object.
This commit is contained in:
parent
9f0b7e99c5
commit
cadd96b3ea
@ -1907,6 +1907,7 @@ virJSONValueGetString;
|
||||
virJSONValueHashFree;
|
||||
virJSONValueIsArray;
|
||||
virJSONValueIsNull;
|
||||
virJSONValueIsObject;
|
||||
virJSONValueNewArray;
|
||||
virJSONValueNewArrayFromBitmap;
|
||||
virJSONValueNewBoolean;
|
||||
|
@ -904,6 +904,16 @@ virJSONValueObjectGetValue(virJSONValuePtr object,
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
virJSONValueIsObject(virJSONValuePtr object)
|
||||
{
|
||||
if (object)
|
||||
return object->type == VIR_JSON_TYPE_OBJECT;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
virJSONValueIsArray(virJSONValuePtr array)
|
||||
{
|
||||
|
@ -114,6 +114,8 @@ virJSONValuePtr virJSONValueObjectGet(virJSONValuePtr object, const char *key);
|
||||
virJSONValuePtr virJSONValueObjectGetByType(virJSONValuePtr object,
|
||||
const char *key, virJSONType type);
|
||||
|
||||
bool virJSONValueIsObject(virJSONValuePtr object);
|
||||
|
||||
bool virJSONValueIsArray(virJSONValuePtr array);
|
||||
ssize_t virJSONValueArraySize(const virJSONValue *array);
|
||||
virJSONValuePtr virJSONValueArrayGet(virJSONValuePtr object, unsigned int element);
|
||||
|
Loading…
Reference in New Issue
Block a user