Introduce two public functions CharToUpper and AsciiCharToUpper.
They have the same functions as InternalCharToUpper and
InternalBaseLibAsciiToUpper.Considering the internal functions will
be removed,so directly I change their function names to the public ones'.
https://bugzilla.tianocore.org/show_bug.cgi?id=1369
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Provides string functions, linked list functions, math functions, synchronization\r
functions, file path functions, and CPU architecture-specific functions.\r
\r
-Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>\r
Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
OUT UINTN *DestinationLength\r
);\r
\r
+/**\r
+ Convert a Unicode character to upper case only if\r
+ it maps to a valid small-case ASCII character.\r
+\r
+ This internal function only deal with Unicode character\r
+ which maps to a valid small-case ASCII character, i.e.\r
+ L'a' to L'z'. For other Unicode character, the input character\r
+ is returned directly.\r
+\r
+ @param Char The character to convert.\r
+\r
+ @retval LowerCharacter If the Char is with range L'a' to L'z'.\r
+ @retval Unchanged Otherwise.\r
+\r
+**/\r
+CHAR16\r
+EFIAPI\r
+CharToUpper (\r
+ IN CHAR16 Char\r
+ );\r
+\r
+/**\r
+ Converts a lowercase Ascii character to upper one.\r
+\r
+ If Chr is lowercase Ascii character, then converts it to upper one.\r
+\r
+ If Value >= 0xA0, then ASSERT().\r
+ If (Value & 0x0F) >= 0x0A, then ASSERT().\r
+\r
+ @param Chr one Ascii character\r
+\r
+ @return The uppercase value of Ascii character\r
+\r
+**/\r
+CHAR8\r
+EFIAPI\r
+AsciiCharToUpper (\r
+ IN CHAR8 Chr\r
+ );\r
+\r
/**\r
Converts an 8-bit value to an 8-bit BCD value.\r
\r
/** @file\r
Safe String functions.\r
\r
- Copyright (c) 2014 - 2018, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2014 - 2019, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
String++;\r
}\r
\r
- if (InternalCharToUpper (*String) == L'X') {\r
+ if (CharToUpper (*String) == L'X') {\r
if (*(String - 1) != L'0') {\r
*Data = 0;\r
return RETURN_SUCCESS;\r
String++;\r
}\r
\r
- if (InternalCharToUpper (*String) == L'X') {\r
+ if (CharToUpper (*String) == L'X') {\r
if (*(String - 1) != L'0') {\r
*Data = 0;\r
return RETURN_SUCCESS;\r
String++;\r
}\r
\r
- if (InternalBaseLibAsciiToUpper (*String) == 'X') {\r
+ if (AsciiCharToUpper (*String) == 'X') {\r
if (*(String - 1) != '0') {\r
*Data = 0;\r
return RETURN_SUCCESS;\r
String++;\r
}\r
\r
- if (InternalBaseLibAsciiToUpper (*String) == 'X') {\r
+ if (AsciiCharToUpper (*String) == 'X') {\r
if (*(String - 1) != '0') {\r
*Data = 0;\r
return RETURN_SUCCESS;\r
/** @file\r
Unicode and ASCII string primitives.\r
\r
- Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
**/\r
CHAR16\r
EFIAPI\r
-InternalCharToUpper (\r
+CharToUpper (\r
IN CHAR16 Char\r
)\r
{\r
return Char - L'0';\r
}\r
\r
- return (10 + InternalCharToUpper (Char) - L'A');\r
+ return (10 + CharToUpper (Char) - L'A');\r
}\r
\r
/**\r
**/\r
CHAR8\r
EFIAPI\r
-InternalBaseLibAsciiToUpper (\r
+AsciiCharToUpper (\r
IN CHAR8 Chr\r
)\r
{\r
return Char - '0';\r
}\r
\r
- return (10 + InternalBaseLibAsciiToUpper (Char) - 'A');\r
+ return (10 + AsciiCharToUpper (Char) - 'A');\r
}\r
\r
\r
ASSERT (AsciiStrSize (FirstString));\r
ASSERT (AsciiStrSize (SecondString));\r
\r
- UpperFirstString = InternalBaseLibAsciiToUpper (*FirstString);\r
- UpperSecondString = InternalBaseLibAsciiToUpper (*SecondString);\r
+ UpperFirstString = AsciiCharToUpper (*FirstString);\r
+ UpperSecondString = AsciiCharToUpper (*SecondString);\r
while ((*FirstString != '\0') && (*SecondString != '\0') && (UpperFirstString == UpperSecondString)) {\r
FirstString++;\r
SecondString++;\r
- UpperFirstString = InternalBaseLibAsciiToUpper (*FirstString);\r
- UpperSecondString = InternalBaseLibAsciiToUpper (*SecondString);\r
+ UpperFirstString = AsciiCharToUpper (*FirstString);\r
+ UpperSecondString = AsciiCharToUpper (*SecondString);\r
}\r
\r
return UpperFirstString - UpperSecondString;\r