TianoCore EDK2 master
|
#include <Uefi.h>
#include <Library/DebugLib.h>
#include <Protocol/RestJsonStructure.h>
#include "RestJsonStructureInternal.h"
Go to the source code of this file.
Variables | |
LIST_ENTRY | mRestJsonStructureList |
EFI_HANDLE | mProtocolHandle |
EFI_REST_JSON_STRUCTURE_PROTOCOL | mRestJsonStructureProtocol |
The implementation of EFI REST Resource JSON to C structure convertor Protocol.
(C) Copyright 2020 Hewlett Packard Enterprise Development LP
Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file RestJsonStructureDxe.c.
EFI_STATUS InterpreterEfiStructToInstance | ( | IN EFI_REST_JSON_STRUCTURE_PROTOCOL * | This, |
IN REST_JSON_STRUCTURE_INSTANCE * | InterpreterInstance, | ||
IN EFI_REST_JSON_STRUCTURE_HEADER * | RestJSonHeader, | ||
OUT CHAR8 ** | ResourceRaw | ||
) |
This function converts JSON C structure to JSON property.
[in] | This | EFI_REST_JSON_STRUCTURE_PROTOCOL instance. |
[in] | InterpreterInstance | REST_JSON_STRUCTURE_INSTANCE |
[in] | RestJSonHeader | Resource type identifier. |
[out] | ResourceRaw | Output in JSON text format. |
EFI_SUCCESS | |
Others. |
Definition at line 260 of file RestJsonStructureDxe.c.
EFI_STATUS InterpreterInstanceDestoryJsonStruct | ( | IN EFI_REST_JSON_STRUCTURE_PROTOCOL * | This, |
IN REST_JSON_STRUCTURE_INSTANCE * | InterpreterInstance, | ||
IN EFI_REST_JSON_STRUCTURE_HEADER * | RestJSonHeader | ||
) |
This function destory REST property structure.
[in] | This | EFI_REST_JSON_STRUCTURE_PROTOCOL instance. |
[in] | InterpreterInstance | REST_JSON_STRUCTURE_INSTANCE |
[in] | RestJSonHeader | Property interpreted from given ResourceRaw. |
EFI_SUCCESS | |
Others. |
Definition at line 356 of file RestJsonStructureDxe.c.
EFI_STATUS InterpreterInstanceToStruct | ( | IN EFI_REST_JSON_STRUCTURE_PROTOCOL * | This, |
IN REST_JSON_STRUCTURE_INSTANCE * | InterpreterInstance, | ||
IN EFI_REST_JSON_RESOURCE_TYPE_IDENTIFIER *RsrcTypeIdentifier | OPTIONAL, | ||
IN CHAR8 * | ResourceRaw, | ||
OUT EFI_REST_JSON_STRUCTURE_HEADER ** | RestJSonHeader | ||
) |
This function check if this interpreter instance support the given namesapce.
[in] | This | EFI_REST_JSON_STRUCTURE_PROTOCOL instance. |
[in] | InterpreterInstance | REST_JSON_STRUCTURE_INSTANCE |
[in] | RsrcTypeIdentifier | Resource type identifier. |
[in] | ResourceRaw | Given Restful resource. |
[out] | RestJSonHeader | Property interpreted from given ResourceRaw. |
EFI_SUCCESS | |
Others. |
Definition at line 124 of file RestJsonStructureDxe.c.
EFI_STATUS EFIAPI RestJsonStructureDestroyStruct | ( | IN EFI_REST_JSON_STRUCTURE_PROTOCOL * | This, |
IN EFI_REST_JSON_STRUCTURE_HEADER * | RestJSonHeader | ||
) |
This function destory REST property EFI structure which returned in JsonToStructure().
[in] | This | EFI_REST_JSON_STRUCTURE_PROTOCOL instance. |
[in] | RestJSonHeader | Property to destory. |
EFI_SUCCESS | |
Others |
Definition at line 535 of file RestJsonStructureDxe.c.
EFI_STATUS EFIAPI RestJsonStructureEntryPoint | ( | IN EFI_HANDLE | ImageHandle, |
IN EFI_SYSTEM_TABLE * | SystemTable | ||
) |
This is the declaration of an EFI image entry point.
ImageHandle | The firmware allocated handle for the UEFI image. |
SystemTable | A pointer to the EFI System Table. |
EFI_SUCCESS | The operation completed successfully. |
Others | An unexpected error occurred. |
Definition at line 656 of file RestJsonStructureDxe.c.
EFI_STATUS EFIAPI RestJsonStructureRegister | ( | IN EFI_REST_JSON_STRUCTURE_PROTOCOL * | This, |
IN EFI_REST_JSON_STRUCTURE_SUPPORTED * | JsonStructureSupported, | ||
IN EFI_REST_JSON_STRUCTURE_TO_STRUCTURE | ToStructure, | ||
IN EFI_REST_JSON_STRUCTURE_TO_JSON | ToJson, | ||
IN EFI_REST_JSON_STRUCTURE_DESTORY_STRUCTURE | DestroyStructure | ||
) |
This function registers Restful resource interpreter for the specific schema.
[in] | This | This is the EFI_REST_JSON_STRUCTURE_PROTOCOL instance. |
[in] | JsonStructureSupported | The type and version of REST JSON resource which this converter supports. |
[in] | ToStructure | The function to convert REST JSON resource to structure. |
[in] | ToJson | The function to convert REST JSON structure to JSON in text format. |
[in] | DestroyStructure | Destroy REST JSON structure returned in ToStructure() function. |
EFI_SUCCESS | Register successfully. |
Others | Fail to register. |
Definition at line 38 of file RestJsonStructureDxe.c.
EFI_STATUS EFIAPI RestJsonStructureToJson | ( | IN EFI_REST_JSON_STRUCTURE_PROTOCOL * | This, |
IN EFI_REST_JSON_STRUCTURE_HEADER * | RestJSonHeader, | ||
OUT CHAR8 ** | ResourceRaw | ||
) |
This function translates the given JSON C Structure to JSON text.
[in] | This | EFI_REST_JSON_STRUCTURE_PROTOCOL instance. |
[in] | RestJSonHeader | Given Restful resource. |
[out] | ResourceRaw | Resource in RESTfuls service oriented. |
EFI_SUCCESS | |
Others | Fail to remove the entry |
Definition at line 588 of file RestJsonStructureDxe.c.
EFI_STATUS EFIAPI RestJsonStructureToStruct | ( | IN EFI_REST_JSON_STRUCTURE_PROTOCOL * | This, |
IN EFI_REST_JSON_RESOURCE_TYPE_IDENTIFIER *RsrcTypeIdentifier | OPTIONAL, | ||
IN CHAR8 * | ResourceJsonText, | ||
OUT EFI_REST_JSON_STRUCTURE_HEADER ** | JsonStructure | ||
) |
This function translates the given JSON text to JSON C Structure.
[in] | This | EFI_REST_JSON_STRUCTURE_PROTOCOL instance. |
[in] | RsrcTypeIdentifier | Resource type identifier. |
[in] | ResourceJsonText | Given Restful resource. |
[out] | JsonStructure | Property interpreted from given ResourceRaw. |
EFI_SUCCESS | |
Others. |
Definition at line 444 of file RestJsonStructureDxe.c.
EFI_STATUS EFIAPI RestJsonStructureUnload | ( | IN EFI_HANDLE | ImageHandle | ) |
This is the unload handle for REST JSON to C structure module.
Disconnect the driver specified by ImageHandle from all the devices in the handle database. Uninstall all the protocols installed in the driver entry point.
[in] | ImageHandle | The drivers' driver image. |
EFI_SUCCESS | The image is unloaded. |
Others | Failed to unload the image. |
Definition at line 691 of file RestJsonStructureDxe.c.
EFI_HANDLE mProtocolHandle |
Definition at line 19 of file RestJsonStructureDxe.c.
LIST_ENTRY mRestJsonStructureList |
Definition at line 18 of file RestJsonStructureDxe.c.
EFI_REST_JSON_STRUCTURE_PROTOCOL mRestJsonStructureProtocol |
Definition at line 638 of file RestJsonStructureDxe.c.