RedfishPkg/JsonLib: Add JsonLoadString function
Add JsonLoadString function to load a NULL terminated-string JSON Signed-off-by: Abner Chang <abner.chang@hpe.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Nickle Wang <nickle.wang@hpe.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Nickle Wang <nickle.wang@hpe.com>
This commit is contained in:
committed by
mergify[bot]
parent
739a506b18
commit
5d7b5cd105
@@ -664,6 +664,27 @@ JsonDumpString (
|
||||
IN UINTN Flags
|
||||
);
|
||||
|
||||
/**
|
||||
Convert a string to JSON object.
|
||||
The function is used to convert a NULL terminated CHAR8 string to a JSON
|
||||
value. Only object and array represented strings can be converted successfully,
|
||||
since they are the only valid root values of a JSON text for UEFI usage.
|
||||
|
||||
Real number and number with exponent part are not supportted by UEFI.
|
||||
|
||||
Caller needs to cleanup the root value by calling JsonValueFree().
|
||||
|
||||
@param[in] String The NULL terminated CHAR8 string to convert.
|
||||
|
||||
@retval Array JSON value or object JSON value, or NULL when any error occurs.
|
||||
|
||||
**/
|
||||
EDKII_JSON_VALUE
|
||||
EFIAPI
|
||||
JsonLoadString (
|
||||
IN CONST CHAR8* String
|
||||
);
|
||||
|
||||
/**
|
||||
Load JSON from a buffer.
|
||||
|
||||
|
Reference in New Issue
Block a user