diff options
author | jcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-08-02 23:33:06 +0000 |
---|---|---|
committer | jcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-08-02 23:33:06 +0000 |
commit | f405c0674aef0fb8bff34acb0011c47f7cd38ea6 (patch) | |
tree | ce09868cf38489b3570ae33e90a9385c2e92b95e /MdePkg/Library/BasePrintLib/PrintLib.c | |
parent | 274402de4642937735918e6c756777c40524957d (diff) | |
download | edk2-platforms-f405c0674aef0fb8bff34acb0011c47f7cd38ea6.tar.xz |
Add 2 functions to UefiLib library class: CatSPrint and CatVSPrint.
Implement these functions in the UefiLib instance.
Add 2 functions to PrintLib library class: SPrintLengthAsciiFormat and SPrintLength.
Implement these functions in the BasePrintLib instance and the DxePrintLib2Protocol instance.
Signed-off-by: jcarsey
Reviewed-by: jljusten
Reviewed-by: geekboy15a
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12081 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdePkg/Library/BasePrintLib/PrintLib.c')
-rw-r--r-- | MdePkg/Library/BasePrintLib/PrintLib.c | 50 |
1 files changed, 49 insertions, 1 deletions
diff --git a/MdePkg/Library/BasePrintLib/PrintLib.c b/MdePkg/Library/BasePrintLib/PrintLib.c index 6add9cbbe6..daeb8d4536 100644 --- a/MdePkg/Library/BasePrintLib/PrintLib.c +++ b/MdePkg/Library/BasePrintLib/PrintLib.c @@ -1,7 +1,7 @@ /** @file
Base Print Library instance implementation.
- Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -694,3 +694,51 @@ AsciiValueToString ( {
return BasePrintLibConvertValueToString (Buffer, Flags, Value, Width, 1);
}
+
+/**
+ Returns the number of characters that would be produced by if the formatted
+ output were produced not including the Null-terminator.
+
+ If FormatString is NULL, then ASSERT().
+ If FormatString is not aligned on a 16-bit boundary, then ASSERT().
+
+ @param[in] FormatString A Null-terminated Unicode format string.
+ @param[in] Marker VA_LIST marker for the variable argument list.
+
+ @return The number of characters that would be produced, not including the
+ Null-terminator.
+**/
+UINTN
+EFIAPI
+SPrintLength (
+ IN CONST CHAR16 *FormatString,
+ IN VA_LIST Marker
+ )
+{
+ ASSERT(FormatString != NULL);
+ ASSERT_UNICODE_BUFFER (FormatString);
+ return BasePrintLibSPrintMarker (NULL, 0, FORMAT_UNICODE | OUTPUT_UNICODE | COUNT_ONLY_NO_PRINT, (CHAR8 *)FormatString, Marker, NULL);
+}
+
+/**
+ Returns the number of characters that would be produced by if the formatted
+ output were produced not including the Null-terminator.
+
+ If FormatString is NULL, then ASSERT().
+
+ @param[in] FormatString A Null-terminated ASCII format string.
+ @param[in] Marker VA_LIST marker for the variable argument list.
+
+ @return The number of characters that would be produced, not including the
+ Null-terminator.
+**/
+UINTN
+EFIAPI
+SPrintLengthAsciiFormat (
+ IN CONST CHAR8 *FormatString,
+ IN VA_LIST Marker
+ )
+{
+ ASSERT(FormatString != NULL);
+ return BasePrintLibSPrintMarker (NULL, 0, OUTPUT_UNICODE | COUNT_ONLY_NO_PRINT, (CHAR8 *)FormatString, Marker, NULL);
+}
|