]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/BasePrintLib/PrintLib.c
Add 2 functions to UefiLib library class: CatSPrint and CatVSPrint.
[mirror_edk2.git] / MdePkg / Library / BasePrintLib / PrintLib.c
index 6add9cbbe653b13dc095e64bc037efe34f5d2a26..daeb8d45365bd19ee90366dfd9e8634fffd50fcf 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Base Print Library instance implementation.\r
 \r
-  Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2006 - 2011, 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
@@ -694,3 +694,51 @@ AsciiValueToString (
 {\r
   return BasePrintLibConvertValueToString (Buffer, Flags, Value, Width, 1);\r
 }\r
+\r
+/**\r
+  Returns the number of characters that would be produced by if the formatted \r
+  output were produced not including the Null-terminator.\r
+\r
+  If FormatString is NULL, then ASSERT().\r
+  If FormatString is not aligned on a 16-bit boundary, then ASSERT().\r
+\r
+  @param[in]  FormatString    A Null-terminated Unicode format string.\r
+  @param[in]  Marker          VA_LIST marker for the variable argument list.\r
+\r
+  @return The number of characters that would be produced, not including the \r
+          Null-terminator.\r
+**/\r
+UINTN\r
+EFIAPI\r
+SPrintLength (\r
+  IN  CONST CHAR16   *FormatString,\r
+  IN  VA_LIST       Marker\r
+  )\r
+{\r
+  ASSERT(FormatString != NULL);\r
+  ASSERT_UNICODE_BUFFER (FormatString);\r
+  return BasePrintLibSPrintMarker (NULL, 0, FORMAT_UNICODE | OUTPUT_UNICODE | COUNT_ONLY_NO_PRINT, (CHAR8 *)FormatString, Marker, NULL);\r
+}\r
+\r
+/**\r
+  Returns the number of characters that would be produced by if the formatted \r
+  output were produced not including the Null-terminator.\r
+\r
+  If FormatString is NULL, then ASSERT().\r
+\r
+  @param[in]  FormatString    A Null-terminated ASCII format string.\r
+  @param[in]  Marker          VA_LIST marker for the variable argument list.\r
+\r
+  @return The number of characters that would be produced, not including the \r
+          Null-terminator.\r
+**/\r
+UINTN\r
+EFIAPI\r
+SPrintLengthAsciiFormat (\r
+  IN  CONST CHAR8   *FormatString,\r
+  IN  VA_LIST       Marker\r
+  )\r
+{\r
+  ASSERT(FormatString != NULL);\r
+  return BasePrintLibSPrintMarker (NULL, 0, OUTPUT_UNICODE | COUNT_ONLY_NO_PRINT, (CHAR8 *)FormatString, Marker, NULL);\r
+}\r