util: json: Add accessor for looking up JSON value type

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
Peter Krempa 2018-03-20 14:07:26 +01:00
parent 38b3b20c66
commit 57cd22bc54
3 changed files with 10 additions and 0 deletions

View File

@ -2041,6 +2041,7 @@ virJSONValueGetNumberLong;
virJSONValueGetNumberUint; virJSONValueGetNumberUint;
virJSONValueGetNumberUlong; virJSONValueGetNumberUlong;
virJSONValueGetString; virJSONValueGetString;
virJSONValueGetType;
virJSONValueHashFree; virJSONValueHashFree;
virJSONValueIsArray; virJSONValueIsArray;
virJSONValueIsNull; virJSONValueIsNull;

View File

@ -68,6 +68,13 @@ struct _virJSONParser {
}; };
virJSONType
virJSONValueGetType(const virJSONValue *value)
{
return value->type;
}
/** /**
* virJSONValueObjectAddVArgs: * virJSONValueObjectAddVArgs:
* @obj: JSON object to add the values to * @obj: JSON object to add the values to

View File

@ -83,6 +83,8 @@ struct _virJSONValue {
void virJSONValueFree(virJSONValuePtr value); void virJSONValueFree(virJSONValuePtr value);
void virJSONValueHashFree(void *opaque, const void *name); void virJSONValueHashFree(void *opaque, const void *name);
virJSONType virJSONValueGetType(const virJSONValue *value);
int virJSONValueObjectCreate(virJSONValuePtr *obj, ...) int virJSONValueObjectCreate(virJSONValuePtr *obj, ...)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_SENTINEL; ATTRIBUTE_NONNULL(1) ATTRIBUTE_SENTINEL;
int virJSONValueObjectCreateVArgs(virJSONValuePtr *obj, va_list args) int virJSONValueObjectCreateVArgs(virJSONValuePtr *obj, va_list args)