From 9971b99461e930008e3d35bc0a4a310b6afa57f6 Mon Sep 17 00:00:00 2001 From: Abner Chang Date: Thu, 11 Jan 2024 16:47:55 +0800 Subject: RedfishPkg/JsonLib: Add JSON delete object function To support the deletion on a specified JSON object. Signed-off-by: Abner Chang Cc: Nickle Wang Cc: Igor Kulchytskyy Reviewed-by: Nickle Wang --- RedfishPkg/Include/Library/JsonLib.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'RedfishPkg/Include') diff --git a/RedfishPkg/Include/Library/JsonLib.h b/RedfishPkg/Include/Library/JsonLib.h index 8f31d93414..ea252291a0 100644 --- a/RedfishPkg/Include/Library/JsonLib.h +++ b/RedfishPkg/Include/Library/JsonLib.h @@ -656,6 +656,23 @@ JsonObjectSetValue ( IN EDKII_JSON_VALUE Json ); +/** + The function is used to delete a JSON key from the given JSON bject, + + @param[in] JsonObj The provided JSON object. + @param[in] Key The key of the JSON value to be deleted. + + @retval EFI_ABORTED Some error occur and operation aborted. + @retval EFI_SUCCESS The JSON value has been deleted from this JSON object. + +**/ +EFI_STATUS +EFIAPI +JsonObjectDelete ( + IN EDKII_JSON_OBJECT JsonObj, + IN CONST CHAR8 *Key + ); + /** The function is used to get the number of elements in a JSON array. Returns or 0 if JsonArray is NULL or not a JSON array. -- cgit v1.2.3