summaryrefslogtreecommitdiffstats
path: root/RedfishPkg/Include
diff options
context:
space:
mode:
authorAbner Chang <abner.chang@amd.com>2024-01-11 16:47:55 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2024-01-16 09:13:03 +0000
commit9971b99461e930008e3d35bc0a4a310b6afa57f6 (patch)
treebc330e731b0e43818c5a4770831fbbd04ea6b7fa /RedfishPkg/Include
parent8f6d343ae639fba8e4b80e45257275e23083431f (diff)
downloadedk2-9971b99461e930008e3d35bc0a4a310b6afa57f6.tar.gz
edk2-9971b99461e930008e3d35bc0a4a310b6afa57f6.tar.bz2
edk2-9971b99461e930008e3d35bc0a4a310b6afa57f6.zip
RedfishPkg/JsonLib: Add JSON delete object function
To support the deletion on a specified JSON object. Signed-off-by: Abner Chang <abner.chang@amd.com> Cc: Nickle Wang <nicklew@nvidia.com> Cc: Igor Kulchytskyy <igork@ami.com> Reviewed-by: Nickle Wang <nicklew@nvidia.com>
Diffstat (limited to 'RedfishPkg/Include')
-rw-r--r--RedfishPkg/Include/Library/JsonLib.h17
1 files changed, 17 insertions, 0 deletions
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
@@ -657,6 +657,23 @@ JsonObjectSetValue (
);
/**
+ 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.