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
return json_dumps((json_t *)JsonValue, 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
+ json_error_t JsonError;\r
+\r
+ return (EDKII_JSON_VALUE) json_loads ((const char *)String, 0, &JsonError);\r
+}\r
+\r
/**\r
Load JSON from a buffer.\r
\r