]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/Strings.c
Retire HiiLibGetNextLanguage() API from HII Library class.
[mirror_edk2.git] / EdkCompatibilityPkg / Compatibility / FrameworkHiiOnUefiHiiThunk / Strings.c
index caa702d5dda17b49fb4ee14afc61ffccc93a2947..3fab323dc70c2c9901bff793af16752a7b5fd646 100644 (file)
@@ -267,6 +267,47 @@ ConvertIso639LanguageToRfc3066Language (
   return NULL;\r
 }\r
 \r
+/**\r
+  Get next language from language code list (with separator ';').\r
+\r
+  If LangCode is NULL, then ASSERT.\r
+  If Lang is NULL, then ASSERT.\r
+\r
+  @param  LangCode    On input: point to first language in the list. On\r
+                                 output: point to next language in the list, or\r
+                                 NULL if no more language in the list.\r
+  @param  Lang           The first language in the list.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+GetNextLanguage (\r
+  IN OUT CHAR8      **LangCode,\r
+  OUT CHAR8         *Lang\r
+  )\r
+{\r
+  UINTN  Index;\r
+  CHAR8  *StringPtr;\r
+\r
+  ASSERT (LangCode != NULL);\r
+  ASSERT (*LangCode != NULL);\r
+  ASSERT (Lang != NULL);\r
+\r
+  Index = 0;\r
+  StringPtr = *LangCode;\r
+  while (StringPtr[Index] != 0 && StringPtr[Index] != ';') {\r
+    Index++;\r
+  }\r
+\r
+  CopyMem (Lang, StringPtr, Index);\r
+  Lang[Index] = 0;\r
+\r
+  if (StringPtr[Index] == ';') {\r
+    Index++;\r
+  }\r
+  *LangCode = StringPtr + Index;\r
+}\r
+\r
 /**\r
   Test if all of the characters in a string have corresponding font characters.\r
 \r