util: Introduce virJSONValueObjectStealObject

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Jiri Denemark 2018-03-28 09:01:30 +02:00
parent dacf2a6bbc
commit bf856b6054
3 changed files with 11 additions and 0 deletions

View File

@ -2098,6 +2098,7 @@ virJSONValueObjectIsNull;
virJSONValueObjectKeysNumber;
virJSONValueObjectRemoveKey;
virJSONValueObjectStealArray;
virJSONValueObjectStealObject;
virJSONValueToString;

View File

@ -1400,6 +1400,14 @@ virJSONValueObjectStealArray(virJSONValuePtr object, const char *key)
}
virJSONValuePtr
virJSONValueObjectStealObject(virJSONValuePtr object,
const char *key)
{
return virJSONValueObjectStealByType(object, key, VIR_JSON_TYPE_OBJECT);
}
int
virJSONValueObjectIsNull(virJSONValuePtr object,
const char *key)

View File

@ -112,6 +112,8 @@ virJSONValuePtr virJSONValueObjectGetArray(virJSONValuePtr object,
const char *key);
virJSONValuePtr virJSONValueObjectStealArray(virJSONValuePtr object,
const char *key);
virJSONValuePtr virJSONValueObjectStealObject(virJSONValuePtr object,
const char *key);
const char *virJSONValueObjectGetString(virJSONValuePtr object, const char *key);
const char *virJSONValueObjectGetStringOrNumber(virJSONValuePtr object, const char *key);