TianoCore EDK2 master
Loading...
Searching...
No Matches
HiiString.c File Reference
#include "InternalHiiLib.h"

Go to the source code of this file.

Functions

EFI_STRING_ID EFIAPI HiiSetString (IN EFI_HII_HANDLE HiiHandle, IN EFI_STRING_ID StringId OPTIONAL, IN CONST EFI_STRING String, IN CONST CHAR8 *SupportedLanguages OPTIONAL)
 
EFI_STRING EFIAPI HiiGetPackageString (IN CONST EFI_GUID *PackageListGuid, IN EFI_STRING_ID StringId, IN CONST CHAR8 *Language OPTIONAL)
 
EFI_STRING EFIAPI HiiGetString (IN EFI_HII_HANDLE HiiHandle, IN EFI_STRING_ID StringId, IN CONST CHAR8 *Language OPTIONAL)
 
EFI_STRING EFIAPI HiiGetStringEx (IN EFI_HII_HANDLE HiiHandle, IN EFI_STRING_ID StringId, IN CONST CHAR8 *Language OPTIONAL, IN BOOLEAN TryBestLanguage)
 

Detailed Description

HII Library implementation that uses DXE protocols and services.

Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.
(C) Copyright 2021 Hewlett Packard Enterprise Development LP
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file HiiString.c.

Function Documentation

◆ HiiGetPackageString()

EFI_STRING EFIAPI HiiGetPackageString ( IN CONST EFI_GUID PackageListGuid,
IN EFI_STRING_ID  StringId,
IN CONST CHAR8 *Language  OPTIONAL 
)

Retrieves a string from a string package names by GUID in a specific language. If the language is not specified, then a string from a string package in the current platform language is retrieved. If the string can not be retrieved using the specified language or the current platform language, then the string is retrieved from the string package in the first language the string package supports. The returned string is allocated using AllocatePool(). The caller is responsible for freeing the allocated buffer using FreePool().

If PackageListGuid is NULL, then ASSERT(). If StringId is 0, then ASSERT.

Parameters
[in]PackageListGuidThe GUID of a package list that was previously registered in the HII Database.
[in]StringIdThe identifier of the string to retrieved from the string package associated with PackageListGuid.
[in]LanguageThe language of the string to retrieve. If this parameter is NULL, then the current platform language is used. The format of Language must follow the language format assumed the HII Database.
Return values
NULLThe package list specified by PackageListGuid is not present in the HII Database.
NULLThe string specified by StringId is not present in the string package.
OtherThe string was returned.

Definition at line 171 of file HiiString.c.

◆ HiiGetString()

EFI_STRING EFIAPI HiiGetString ( IN EFI_HII_HANDLE  HiiHandle,
IN EFI_STRING_ID  StringId,
IN CONST CHAR8 *Language  OPTIONAL 
)

Retrieves a string from a string package in a specific language specified in Language or in the best lanaguage. See HiiGetStringEx () for the details.

Parameters
[in]HiiHandleA handle that was previously registered in the HII Database.
[in]StringIdThe identifier of the string to retrieved from the string package associated with HiiHandle.
[in]LanguageThe language of the string to retrieve. If this parameter is NULL, then the current platform language is used. The format of Language must follow the language format assumed the HII Database.
Return values
NULLThe string specified by StringId is not present in the string package.
OtherThe string was returned.

Definition at line 211 of file HiiString.c.

◆ HiiGetStringEx()

EFI_STRING EFIAPI HiiGetStringEx ( IN EFI_HII_HANDLE  HiiHandle,
IN EFI_STRING_ID  StringId,
IN CONST CHAR8 *Language  OPTIONAL,
IN BOOLEAN  TryBestLanguage 
)

Retrieves a string from a string package in a specific language or in the best language at discretion of this function according to the priority of languages. TryBestLanguage is used to get the string in the best language or in the language specified in Language parameter. The behavior is, If TryBestLanguage is TRUE, this function looks for the best language for the string.

  • If the string can not be retrieved using the specified language or the current platform language, then the string is retrieved from the string package in the first language the string package supports. If TryBestLanguage is FALSE, Language must be specified for retrieving the string.

The returned string is allocated using AllocatePool(). The caller is responsible for freeing the allocated buffer using FreePool().

If HiiHandle is NULL, then ASSERT(). If StringId is 0, then ASSET. If TryBestLanguage is FALE and Language is NULL, then ASSERT().

Parameters
[in]HiiHandleA handle that was previously registered in the HII Database.
[in]StringIdThe identifier of the string to retrieved from the string package associated with HiiHandle.
[in]LanguageThe language of the string to retrieve. If this parameter is NULL, then the current platform language is used. The format of Language must follow the language format assumed the HII Database.
[in]TryBestLanguageIf TRUE, try to get the best matching language from all supported languages.If FALSE, the Language must be assigned for the StringID.
Return values
NULLThe string specified by StringId is not present in the string package.
OtherThe string was returned.

Definition at line 255 of file HiiString.c.

◆ HiiSetString()

EFI_STRING_ID EFIAPI HiiSetString ( IN EFI_HII_HANDLE  HiiHandle,
IN EFI_STRING_ID StringId  OPTIONAL,
IN CONST EFI_STRING  String,
IN CONST CHAR8 *SupportedLanguages  OPTIONAL 
)

This function create a new string in String Package or updates an existing string in a String Package. If StringId is 0, then a new string is added to a String Package. If StringId is not zero, then a string in String Package is updated. If SupportedLanguages is NULL, then the string is added or updated for all the languages that the String Package supports. If SupportedLanguages is not NULL, then the string is added or updated for the set of languages specified by SupportedLanguages.

If HiiHandle is NULL, then ASSERT(). If String is NULL, then ASSERT().

Parameters
[in]HiiHandleA handle that was previously registered in the HII Database.
[in]StringIdIf zero, then a new string is created in the String Package associated with HiiHandle. If non-zero, then the string specified by StringId is updated in the String Package associated with HiiHandle.
[in]StringA pointer to the Null-terminated Unicode string to add or update in the String Package associated with HiiHandle.
[in]SupportedLanguagesA pointer to a Null-terminated ASCII string of language codes. If this parameter is NULL, then String is added or updated in the String Package associated with HiiHandle for all the languages that the String Package supports. If this parameter is not NULL, then then String is added or updated in the String Package associated with HiiHandle for the set oflanguages specified by SupportedLanguages. The format of SupportedLanguages must follow the language format assumed the HII Database.
Return values
0The string could not be added or updated in the String Package.
OtherThe EFI_STRING_ID of the newly added or updated string.

Definition at line 52 of file HiiString.c.