spa-json: add _is_container () API

This commit is contained in:
Ashok Sidipotu 2022-04-25 10:23:38 +05:30 committed by Julian Bouzas
parent 75c61f9388
commit 229f5d0630
2 changed files with 18 additions and 2 deletions

View file

@ -575,7 +575,7 @@ wp_spa_json_is_string (WpSpaJson *self)
}
/*!
* \brief Checks wether the spa json is of type array or not
* \brief Checks whether the spa json is of type array or not
*
* \ingroup wpspajson
* \param self the spa json object
@ -588,7 +588,20 @@ wp_spa_json_is_array (WpSpaJson *self)
}
/*!
* \brief Checks wether the spa json is of type object or not
* \brief Checks whether the spa json is of type container or not
*
* \ingroup wpspajson
* \param self the spa json object
* \returns TRUE if it is of type container, FALSE otherwise
*/
gboolean
wp_spa_json_is_container (WpSpaJson *self)
{
return spa_json_is_container (self->data, self->size);
}
/*!
* \brief Checks whether the spa json is of type object or not
*
* \ingroup wpspajson
* \param self the spa json object

View file

@ -112,6 +112,9 @@ gboolean wp_spa_json_is_string (WpSpaJson *self);
WP_API
gboolean wp_spa_json_is_array (WpSpaJson *self);
WP_API
gboolean wp_spa_json_is_container (WpSpaJson *self);
WP_API
gboolean wp_spa_json_is_object (WpSpaJson *self);