Retire HiiLibGetNextLanguage() API from HII Library class.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8109 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@ -334,7 +334,7 @@ LangCodes3066To639 (
|
|||||||
Index = 0;
|
Index = 0;
|
||||||
AsciiLangCodes = LangCodes3066;
|
AsciiLangCodes = LangCodes3066;
|
||||||
while (AsciiStrLen (AsciiLangCodes) != 0) {
|
while (AsciiStrLen (AsciiLangCodes) != 0) {
|
||||||
HiiLibGetNextLanguage (&AsciiLangCodes, Lang);
|
GetNextLanguage (&AsciiLangCodes, Lang);
|
||||||
Index++;
|
Index++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -352,7 +352,7 @@ LangCodes3066To639 (
|
|||||||
AsciiLangCodes = LangCodes3066;
|
AsciiLangCodes = LangCodes3066;
|
||||||
|
|
||||||
for (Index = 0; Index < Count; Index++) {
|
for (Index = 0; Index < Count; Index++) {
|
||||||
HiiLibGetNextLanguage (&AsciiLangCodes, Lang);
|
GetNextLanguage (&AsciiLangCodes, Lang);
|
||||||
Status = ConvertRfc3066LanguageToIso639Language (Lang, *LangCodes639 + Index * ISO_639_2_ENTRY_SIZE);
|
Status = ConvertRfc3066LanguageToIso639Language (Lang, *LangCodes639 + Index * ISO_639_2_ENTRY_SIZE);
|
||||||
ASSERT_EFI_ERROR (Status);
|
ASSERT_EFI_ERROR (Status);
|
||||||
}
|
}
|
||||||
|
@ -529,6 +529,26 @@ ConvertIso639LanguageToRfc3066Language (
|
|||||||
)
|
)
|
||||||
;
|
;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Get next language from language code list (with separator ';').
|
||||||
|
|
||||||
|
If LangCode is NULL, then ASSERT.
|
||||||
|
If Lang is NULL, then ASSERT.
|
||||||
|
|
||||||
|
@param LangCode On input: point to first language in the list. On
|
||||||
|
output: point to next language in the list, or
|
||||||
|
NULL if no more language in the list.
|
||||||
|
@param Lang The first language in the list.
|
||||||
|
|
||||||
|
**/
|
||||||
|
VOID
|
||||||
|
EFIAPI
|
||||||
|
GetNextLanguage (
|
||||||
|
IN OUT CHAR8 **LangCode,
|
||||||
|
OUT CHAR8 *Lang
|
||||||
|
)
|
||||||
|
;
|
||||||
|
|
||||||
#include "Utility.h"
|
#include "Utility.h"
|
||||||
#include "ConfigAccess.h"
|
#include "ConfigAccess.h"
|
||||||
|
|
||||||
|
@ -267,6 +267,47 @@ ConvertIso639LanguageToRfc3066Language (
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Get next language from language code list (with separator ';').
|
||||||
|
|
||||||
|
If LangCode is NULL, then ASSERT.
|
||||||
|
If Lang is NULL, then ASSERT.
|
||||||
|
|
||||||
|
@param LangCode On input: point to first language in the list. On
|
||||||
|
output: point to next language in the list, or
|
||||||
|
NULL if no more language in the list.
|
||||||
|
@param Lang The first language in the list.
|
||||||
|
|
||||||
|
**/
|
||||||
|
VOID
|
||||||
|
EFIAPI
|
||||||
|
GetNextLanguage (
|
||||||
|
IN OUT CHAR8 **LangCode,
|
||||||
|
OUT CHAR8 *Lang
|
||||||
|
)
|
||||||
|
{
|
||||||
|
UINTN Index;
|
||||||
|
CHAR8 *StringPtr;
|
||||||
|
|
||||||
|
ASSERT (LangCode != NULL);
|
||||||
|
ASSERT (*LangCode != NULL);
|
||||||
|
ASSERT (Lang != NULL);
|
||||||
|
|
||||||
|
Index = 0;
|
||||||
|
StringPtr = *LangCode;
|
||||||
|
while (StringPtr[Index] != 0 && StringPtr[Index] != ';') {
|
||||||
|
Index++;
|
||||||
|
}
|
||||||
|
|
||||||
|
CopyMem (Lang, StringPtr, Index);
|
||||||
|
Lang[Index] = 0;
|
||||||
|
|
||||||
|
if (StringPtr[Index] == ';') {
|
||||||
|
Index++;
|
||||||
|
}
|
||||||
|
*LangCode = StringPtr + Index;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Test if all of the characters in a string have corresponding font characters.
|
Test if all of the characters in a string have corresponding font characters.
|
||||||
|
|
||||||
|
@ -195,7 +195,7 @@ FrontPageCallback (
|
|||||||
Index = 0;
|
Index = 0;
|
||||||
LangCode = LanguageString;
|
LangCode = LanguageString;
|
||||||
while (*LangCode != 0) {
|
while (*LangCode != 0) {
|
||||||
HiiLibGetNextLanguage (&LangCode, Lang);
|
GetNextLanguage (&LangCode, Lang);
|
||||||
|
|
||||||
if (Index == Value->u8) {
|
if (Index == Value->u8) {
|
||||||
break;
|
break;
|
||||||
@ -419,7 +419,7 @@ InitializeFrontPage (
|
|||||||
OptionCount = 0;
|
OptionCount = 0;
|
||||||
LangCode = LanguageString;
|
LangCode = LanguageString;
|
||||||
while (*LangCode != 0) {
|
while (*LangCode != 0) {
|
||||||
HiiLibGetNextLanguage (&LangCode, Lang);
|
GetNextLanguage (&LangCode, Lang);
|
||||||
|
|
||||||
if (gFrontPagePrivate.LanguageToken == NULL) {
|
if (gFrontPagePrivate.LanguageToken == NULL) {
|
||||||
//
|
//
|
||||||
|
@ -448,6 +448,47 @@ ConvertRfc3066LanguageToIso639Language (
|
|||||||
return EFI_NOT_FOUND;
|
return EFI_NOT_FOUND;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Get next language from language code list (with separator ';').
|
||||||
|
|
||||||
|
If LangCode is NULL, then ASSERT.
|
||||||
|
If Lang is NULL, then ASSERT.
|
||||||
|
|
||||||
|
@param LangCode On input: point to first language in the list. On
|
||||||
|
output: point to next language in the list, or
|
||||||
|
NULL if no more language in the list.
|
||||||
|
@param Lang The first language in the list.
|
||||||
|
|
||||||
|
**/
|
||||||
|
VOID
|
||||||
|
EFIAPI
|
||||||
|
GetNextLanguage (
|
||||||
|
IN OUT CHAR8 **LangCode,
|
||||||
|
OUT CHAR8 *Lang
|
||||||
|
)
|
||||||
|
{
|
||||||
|
UINTN Index;
|
||||||
|
CHAR8 *StringPtr;
|
||||||
|
|
||||||
|
ASSERT (LangCode != NULL);
|
||||||
|
ASSERT (*LangCode != NULL);
|
||||||
|
ASSERT (Lang != NULL);
|
||||||
|
|
||||||
|
Index = 0;
|
||||||
|
StringPtr = *LangCode;
|
||||||
|
while (StringPtr[Index] != 0 && StringPtr[Index] != ';') {
|
||||||
|
Index++;
|
||||||
|
}
|
||||||
|
|
||||||
|
CopyMem (Lang, StringPtr, Index);
|
||||||
|
Lang[Index] = 0;
|
||||||
|
|
||||||
|
if (StringPtr[Index] == ';') {
|
||||||
|
Index++;
|
||||||
|
}
|
||||||
|
*LangCode = StringPtr + Index;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Determine the current language that will be used
|
Determine the current language that will be used
|
||||||
based on language related EFI Variables.
|
based on language related EFI Variables.
|
||||||
|
@ -34,6 +34,25 @@ ConvertRfc3066LanguageToIso639Language (
|
|||||||
OUT CHAR8 *LanguageIso639
|
OUT CHAR8 *LanguageIso639
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Get next language from language code list (with separator ';').
|
||||||
|
|
||||||
|
If LangCode is NULL, then ASSERT.
|
||||||
|
If Lang is NULL, then ASSERT.
|
||||||
|
|
||||||
|
@param LangCode On input: point to first language in the list. On
|
||||||
|
output: point to next language in the list, or
|
||||||
|
NULL if no more language in the list.
|
||||||
|
@param Lang The first language in the list.
|
||||||
|
|
||||||
|
**/
|
||||||
|
VOID
|
||||||
|
EFIAPI
|
||||||
|
GetNextLanguage (
|
||||||
|
IN OUT CHAR8 **LangCode,
|
||||||
|
OUT CHAR8 *Lang
|
||||||
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Determine the current language that will be used
|
Determine the current language that will be used
|
||||||
based on language related EFI Variables.
|
based on language related EFI Variables.
|
||||||
|
@ -223,26 +223,6 @@ HiiGetHiiHandles (
|
|||||||
)
|
)
|
||||||
;
|
;
|
||||||
|
|
||||||
/**
|
|
||||||
Get next language from language code list (with separator ';').
|
|
||||||
|
|
||||||
If LangCode is NULL, then ASSERT.
|
|
||||||
If Lang is NULL, then ASSERT.
|
|
||||||
|
|
||||||
@param LangCode On input: point to first language in the list. On
|
|
||||||
output: point to next language in the list, or
|
|
||||||
NULL if no more language in the list.
|
|
||||||
@param Lang The first language in the list.
|
|
||||||
|
|
||||||
**/
|
|
||||||
VOID
|
|
||||||
EFIAPI
|
|
||||||
HiiLibGetNextLanguage (
|
|
||||||
IN OUT CHAR8 **LangCode,
|
|
||||||
OUT CHAR8 *Lang
|
|
||||||
)
|
|
||||||
;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Retrieves a pointer to the a Null-terminated ASCII string containing the list
|
Retrieves a pointer to the a Null-terminated ASCII string containing the list
|
||||||
of languages that an HII handle in the HII Database supports. The returned
|
of languages that an HII handle in the HII Database supports. The returned
|
||||||
|
@ -15,48 +15,6 @@
|
|||||||
|
|
||||||
#include "InternalHiiLib.h"
|
#include "InternalHiiLib.h"
|
||||||
|
|
||||||
/**
|
|
||||||
Get next language from language code list (with separator ';').
|
|
||||||
|
|
||||||
If LangCode is NULL, then ASSERT.
|
|
||||||
If Lang is NULL, then ASSERT.
|
|
||||||
|
|
||||||
@param LangCode On input: point to first language in the list. On
|
|
||||||
output: point to next language in the list, or
|
|
||||||
NULL if no more language in the list.
|
|
||||||
@param Lang The first language in the list.
|
|
||||||
|
|
||||||
**/
|
|
||||||
VOID
|
|
||||||
EFIAPI
|
|
||||||
HiiLibGetNextLanguage (
|
|
||||||
IN OUT CHAR8 **LangCode,
|
|
||||||
OUT CHAR8 *Lang
|
|
||||||
)
|
|
||||||
{
|
|
||||||
UINTN Index;
|
|
||||||
CHAR8 *StringPtr;
|
|
||||||
|
|
||||||
ASSERT (LangCode != NULL);
|
|
||||||
ASSERT (*LangCode != NULL);
|
|
||||||
ASSERT (Lang != NULL);
|
|
||||||
|
|
||||||
Index = 0;
|
|
||||||
StringPtr = *LangCode;
|
|
||||||
while (StringPtr[Index] != 0 && StringPtr[Index] != ';') {
|
|
||||||
Index++;
|
|
||||||
}
|
|
||||||
|
|
||||||
CopyMem (Lang, StringPtr, Index);
|
|
||||||
Lang[Index] = 0;
|
|
||||||
|
|
||||||
if (StringPtr[Index] == ';') {
|
|
||||||
Index++;
|
|
||||||
}
|
|
||||||
*LangCode = StringPtr + Index;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Retrieves a pointer to the a Null-terminated ASCII string containing the list
|
Retrieves a pointer to the a Null-terminated ASCII string containing the list
|
||||||
of languages that an HII handle in the HII Database supports. The returned
|
of languages that an HII handle in the HII Database supports. The returned
|
||||||
|
Reference in New Issue
Block a user