]> git.proxmox.com Git - mirror_edk2.git/blobdiff - RedfishPkg/Include/Library/JsonLib.h
RedfishPkg/JsonLib: Add JsonLoadString function
[mirror_edk2.git] / RedfishPkg / Include / Library / JsonLib.h
index 3c10f67d2760a391655d996b7be883587ff62310..8a30c5250bb58a23ea6a6720c8a657c1d43860f4 100644 (file)
@@ -664,6 +664,27 @@ JsonDumpString (
   IN    UINTN               Flags\r
   );\r
 \r
+/**\r
+  Convert a string to JSON object.\r
+  The function is used to convert a NULL terminated CHAR8 string to a JSON\r
+  value. Only object and array represented strings can be converted successfully,\r
+  since they are the only valid root values of a JSON text for UEFI usage.\r
+\r
+  Real number and number with exponent part are not supportted by UEFI.\r
+\r
+  Caller needs to cleanup the root value by calling JsonValueFree().\r
+\r
+  @param[in]   String        The NULL terminated CHAR8 string to convert.\r
+\r
+  @retval      Array JSON value or object JSON value, or NULL when any error occurs.\r
+\r
+**/\r
+EDKII_JSON_VALUE\r
+EFIAPI\r
+JsonLoadString (\r
+  IN   CONST CHAR8*    String\r
+  );\r
+\r
 /**\r
   Load JSON from a buffer.\r
 \r