]>
git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Library/PrintLib.h
2 Provides services to print a formatted string to a buffer. All combinations of
3 Unicode and ASCII strings are supported.
5 Copyright (c) 2006 - 2008, Intel Corporation
6 All rights reserved. This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
14 The Print Library functions provide a simple means to produce formatted output
15 strings. Many of the output functions use a format string to describe how to
16 format the output of variable arguments. The format string consists of normal
17 text and argument descriptors. There are no restrictions for how the normal
18 text and argument descriptors can be mixed. A normal text character '\n' must
19 always be converted to '\n\r'. This does not follow the ANSI C standard for
20 sprint(). The format of argument descriptors is described below. The ANSI C
21 standard for sprint() has been followed for some of the format types, and has
22 not been followed for others. The exceptions are noted below.
24 %[flags][width][.precision]type
28 - The field is left justified. If not flag is not specified, then the
29 field is right justified.
31 - Prefix a space character to a number. Only valid for types X, x, and d.
33 - Prefix a plus character to a number. Only valid for types X, x, and d.
34 If both space and + are specified, then space is ignored.
36 - Pad with 0 characters to the left of a number. Only valid for types
39 - Place a comma every 3rd digit of the number. Only valid for type d.
40 If 0 is also specified, then 0 is ignored.
42 - The number being printed is a UINT64. Only valid for types X, x, and d.
43 If this flag is not specified, then the number being printed is a int.
44 - NOTE: All invalid flags are ignored.
49 - The width of the field is specified by a UINTN argument in the
52 - The number specified as a decimal value represents the width of
54 - NOTE: If [width] is not specified, then a field width of 0 is assumed.
59 - The prevision of the field is specified by a UINTN argument in the
62 - The number specified as a decimal value represents the precision of
64 - NOTE: If [.precision] is not specified, then a precision of 0 is assumed.
71 - The argument is a Unicode character. ASCII characters can be printed
72 using this type too by making sure bits 8..15 of the argument are set to 0.
74 - The argument is a hexadecimal number. The characters used are 0..9 and
75 A..F. If the flag 'L' is not specified, then the argument is assumed
76 to be an int. This does not follow ANSI C.
78 - The argument is a hexadecimal number and the number is padded with
79 zeros. This is equivalent to a format string of "0x". If the flag
80 'L' is not specified, then the argument is assumed to be an int.
81 This does not follow ANSI C.
83 - The argument is a decimal number. If the flag 'L' is not specified,
84 then the argument is assumed to be an int.
86 - The argument is a pointer that is a (VOID *), and it is printed as a
87 hexadecimal number The characters used are 0..9 and A..F.
89 - The argument is a pointer to an ASCII string.
90 This does not follow ANSI C.
92 - The argument is a pointer to a Unicode string.
93 This does not follow ANSI C.
95 - The argument is a pointer to a GUID structure. The GUID is printed
96 in the format XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX.
97 This does not follow ANSI C.
99 - The argument is a pointer to an EFI_TIME structure. The time and
100 date are printed in the format "mm/dd/yyyy hh:mm" where mm is the
101 month zero padded, dd is the day zero padded, yyyy is the year zero
102 padded, hh is the hour zero padded, and mm is minutes zero padded.
103 This does not follow ANSI C.
105 - The argument is a RETURN_STATUS value. This value is converted to
106 a string following the table below. This does not follow ANSI C.
111 - RETURN_INVALID_PARAMETER
112 - "Invalid Parameter"
115 - RETURN_BAD_BUFFER_SIZE
117 - RETURN_BUFFER_TOO_SMALL
121 - RETURN_DEVICE_ERROR
123 - RETURN_WRITE_PROTECTED
125 - RETURN_OUT_OF_RESOURCES
127 - RETURN_VOLUME_CORRUPTED
133 - RETURN_MEDIA_CHANGED
137 - RETURN_ACCESS_DENIED
147 - RETURN_ALREADY_STARTED
155 - RETURN_PROTOCOL_ERROR
157 - RETURN_WARN_UNKNOWN_GLYPH
158 - "Warning Unknown Glyph"
159 - RETURN_WARN_DELETE_FAILURE
160 - "Warning Delete Failure"
161 - RETURN_WARN_WRITE_FAILURE
162 - "Warning Write Failure"
163 - RETURN_WARN_BUFFER_TOO_SMALL
164 - "Warning Buffer Too Small"
168 #ifndef __PRINT_LIB_H__
169 #define __PRINT_LIB_H__
172 /// Define the maximum number of characters that are required to
173 /// encode a decimal, hexadecimal, GUID, or TIME value with a NULL
176 /// Maximum Length Decimal String = 28
177 /// "-9,223,372,036,854,775,808"
178 /// Maximum Length Hexadecimal String = 17
179 /// "FFFFFFFFFFFFFFFF"
180 /// Maximum Length GUID = 37
181 /// "00000000-0000-0000-0000-000000000000"
182 /// Maximum Length TIME = 18
183 /// "12/12/2006 12:12"
185 #define MAXIMUM_VALUE_CHARACTERS 38
188 /// Flags bitmask values use in UnicodeValueToString() and
189 /// AsciiValueToString()
191 #define LEFT_JUSTIFY 0x01
192 #define COMMA_TYPE 0x08
193 #define PREFIX_ZERO 0x20
194 #define RADIX_HEX 0x80
197 Produces a Null-terminated Unicode string in an output buffer based on
198 a Null-terminated Unicode format string and a VA_LIST argument list
200 Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer
202 The Unicode string is produced by parsing the format string specified by FormatString.
203 Arguments are pulled from the variable argument list specified by Marker based on the
204 contents of the format string.
205 The number of Unicode characters in the produced output buffer is returned not including
207 If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.
209 If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT().
210 If BufferSize > 1 and StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().
211 If BufferSize > 1 and FormatString is NULL, then ASSERT().
212 If BufferSize > 1 and FormatString is not aligned on a 16-bit boundary, then ASSERT().
213 If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than
214 PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then
216 If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string
217 contains more than PcdMaximumUnicodeStringLength Unicode characters not including the
218 Null-terminator, then ASSERT().
220 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
222 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
223 @param FormatString Null-terminated Unicode format string.
224 @param Marker VA_LIST marker for the variable argument list.
226 @return The number of Unicode characters in the produced output buffer not including the
233 OUT CHAR16
*StartOfBuffer
,
235 IN CONST CHAR16
*FormatString
,
240 Produces a Null-terminated Unicode string in an output buffer based on
241 a Null-terminated Unicode format string and a BASE_LIST argument list
243 Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer
245 The Unicode string is produced by parsing the format string specified by FormatString.
246 Arguments are pulled from the variable argument list specified by Marker based on the
247 contents of the format string.
248 The number of Unicode characters in the produced output buffer is returned not including
250 If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.
252 If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT().
253 If BufferSize > 1 and StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().
254 If BufferSize > 1 and FormatString is NULL, then ASSERT().
255 If BufferSize > 1 and FormatString is not aligned on a 16-bit boundary, then ASSERT().
256 If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than
257 PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then
259 If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string
260 contains more than PcdMaximumUnicodeStringLength Unicode characters not including the
261 Null-terminator, then ASSERT().
263 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
265 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
266 @param FormatString Null-terminated Unicode format string.
267 @param Marker BASE_LIST marker for the variable argument list.
269 @return The number of Unicode characters in the produced output buffer not including the
276 OUT CHAR16
*StartOfBuffer
,
278 IN CONST CHAR16
*FormatString
,
283 Produces a Null-terminated Unicode string in an output buffer based on a Null-terminated
284 Unicode format string and variable argument list.
286 Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer
288 The Unicode string is produced by parsing the format string specified by FormatString.
289 Arguments are pulled from the variable argument list based on the contents of the format string.
290 The number of Unicode characters in the produced output buffer is returned not including
292 If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.
294 If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT().
295 If BufferSize > 1 and StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().
296 If BufferSize > 1 and FormatString is NULL, then ASSERT().
297 If BufferSize > 1 and FormatString is not aligned on a 16-bit boundary, then ASSERT().
298 If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than
299 PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then
301 If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string
302 contains more than PcdMaximumUnicodeStringLength Unicode characters not including the
303 Null-terminator, then ASSERT().
305 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
307 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
308 @param FormatString Null-terminated Unicode format string.
309 @param ... Variable argument list whose contents are accessed based on the
310 format string specified by FormatString.
312 @return The number of Unicode characters in the produced output buffer not including the
319 OUT CHAR16
*StartOfBuffer
,
321 IN CONST CHAR16
*FormatString
,
326 Produces a Null-terminated Unicode string in an output buffer based on a Null-terminated
327 ASCII format string and a VA_LIST argument list
329 Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer
331 The Unicode string is produced by parsing the format string specified by FormatString.
332 Arguments are pulled from the variable argument list specified by Marker based on the
333 contents of the format string.
334 The number of Unicode characters in the produced output buffer is returned not including
336 If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.
338 If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT().
339 If BufferSize > 1 and StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().
340 If BufferSize > 1 and FormatString is NULL, then ASSERT().
341 If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than
342 PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator, then
344 If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string
345 contains more than PcdMaximumUnicodeStringLength Unicode characters not including the
346 Null-terminator, then ASSERT().
348 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
350 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
351 @param FormatString Null-terminated ASCII format string.
352 @param Marker VA_LIST marker for the variable argument list.
354 @return The number of Unicode characters in the produced output buffer not including the
360 UnicodeVSPrintAsciiFormat (
361 OUT CHAR16
*StartOfBuffer
,
363 IN CONST CHAR8
*FormatString
,
368 Produces a Null-terminated Unicode string in an output buffer based on a Null-terminated
369 ASCII format string and a BASE_LIST argument list
371 Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer
373 The Unicode string is produced by parsing the format string specified by FormatString.
374 Arguments are pulled from the variable argument list specified by Marker based on the
375 contents of the format string.
376 The number of Unicode characters in the produced output buffer is returned not including
378 If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.
380 If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT().
381 If BufferSize > 1 and StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().
382 If BufferSize > 1 and FormatString is NULL, then ASSERT().
383 If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than
384 PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator, then
386 If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string
387 contains more than PcdMaximumUnicodeStringLength Unicode characters not including the
388 Null-terminator, then ASSERT().
390 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
392 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
393 @param FormatString Null-terminated ASCII format string.
394 @param Marker BASE_LIST marker for the variable argument list.
396 @return The number of Unicode characters in the produced output buffer not including the
402 UnicodeBSPrintAsciiFormat (
403 OUT CHAR16
*StartOfBuffer
,
405 IN CONST CHAR8
*FormatString
,
410 Produces a Null-terminated Unicode string in an output buffer based on a Null-terminated
411 ASCII format string and variable argument list.
413 Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer
415 The Unicode string is produced by parsing the format string specified by FormatString.
416 Arguments are pulled from the variable argument list based on the contents of the
418 The number of Unicode characters in the produced output buffer is returned not including
420 If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.
422 If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT().
423 If BufferSize > 1 and StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().
424 If BufferSize > 1 and FormatString is NULL, then ASSERT().
425 If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than
426 PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator, then
428 If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string
429 contains more than PcdMaximumUnicodeStringLength Unicode characters not including the
430 Null-terminator, then ASSERT().
432 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
434 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
435 @param FormatString Null-terminated ASCII format string.
436 @param ... Variable argument list whose contents are accessed based on the
437 format string specified by FormatString.
439 @return The number of Unicode characters in the produced output buffer not including the
445 UnicodeSPrintAsciiFormat (
446 OUT CHAR16
*StartOfBuffer
,
448 IN CONST CHAR8
*FormatString
,
453 Converts a decimal value to a Null-terminated Unicode string.
455 Converts the decimal number specified by Value to a Null-terminated Unicode
456 string specified by Buffer containing at most Width characters. No padding of spaces
457 is ever performed. If Width is 0 then a width of MAXIMUM_VALUE_CHARACTERS is assumed.
458 The number of Unicode characters in Buffer is returned not including the Null-terminator.
459 If the conversion contains more than Width characters, then only the first
460 Width characters are returned, and the total number of characters
461 required to perform the conversion is returned.
462 Additional conversion parameters are specified in Flags.
464 The Flags bit LEFT_JUSTIFY is always ignored.
465 All conversions are left justified in Buffer.
466 If Width is 0, PREFIX_ZERO is ignored in Flags.
467 If COMMA_TYPE is set in Flags, then PREFIX_ZERO is ignored in Flags, and commas
468 are inserted every 3rd digit starting from the right.
469 If HEX_RADIX is set in Flags, then the output buffer will be
470 formatted in hexadecimal format.
471 If Value is < 0 and HEX_RADIX is not set in Flags, then the fist character in Buffer is a '-'.
472 If PREFIX_ZERO is set in Flags and PREFIX_ZERO is not being ignored,
473 then Buffer is padded with '0' characters so the combination of the optional '-'
474 sign character, '0' characters, digit characters for Value, and the Null-terminator
475 add up to Width characters.
476 If both COMMA_TYPE and HEX_RADIX are set in Flags, then ASSERT().
477 If Buffer is NULL, then ASSERT().
478 If Buffer is not aligned on a 16-bit boundary, then ASSERT().
479 If unsupported bits are set in Flags, then ASSERT().
480 If both COMMA_TYPE and HEX_RADIX are set in Flags, then ASSERT().
481 If Width >= MAXIMUM_VALUE_CHARACTERS, then ASSERT()
483 @param Buffer Pointer to the output buffer for the produced Null-terminated
485 @param Flags The bitmask of flags that specify left justification, zero pad, and commas.
486 @param Value The 64-bit signed value to convert to a string.
487 @param Width The maximum number of Unicode characters to place in Buffer, not including
490 @return The number of Unicode characters in Buffer not including the Null-terminator.
495 UnicodeValueToString (
496 IN OUT CHAR16
*Buffer
,
503 Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated
504 ASCII format string and a VA_LIST argument list.
506 Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer
508 The ASCII string is produced by parsing the format string specified by FormatString.
509 Arguments are pulled from the variable argument list specified by Marker based on
510 the contents of the format string.
511 The number of ASCII characters in the produced output buffer is returned not including
513 If BufferSize is 0, then no output buffer is produced and 0 is returned.
515 If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT().
516 If BufferSize > 0 and FormatString is NULL, then ASSERT().
517 If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than
518 PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator, then
520 If PcdMaximumAsciiStringLength is not zero, and produced Null-terminated ASCII string
521 contains more than PcdMaximumAsciiStringLength ASCII characters not including the
522 Null-terminator, then ASSERT().
524 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
526 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
527 @param FormatString Null-terminated ASCII format string.
528 @param Marker VA_LIST marker for the variable argument list.
530 @return The number of ASCII characters in the produced output buffer not including the
537 OUT CHAR8
*StartOfBuffer
,
539 IN CONST CHAR8
*FormatString
,
544 Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated
545 ASCII format string and a BASE_LIST argument list.
547 Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer
549 The ASCII string is produced by parsing the format string specified by FormatString.
550 Arguments are pulled from the variable argument list specified by Marker based on
551 the contents of the format string.
552 The number of ASCII characters in the produced output buffer is returned not including
554 If BufferSize is 0, then no output buffer is produced and 0 is returned.
556 If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT().
557 If BufferSize > 0 and FormatString is NULL, then ASSERT().
558 If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than
559 PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator, then
561 If PcdMaximumAsciiStringLength is not zero, and produced Null-terminated ASCII string
562 contains more than PcdMaximumAsciiStringLength ASCII characters not including the
563 Null-terminator, then ASSERT().
565 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
567 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
568 @param FormatString Null-terminated ASCII format string.
569 @param Marker BASE_LIST marker for the variable argument list.
571 @return The number of ASCII characters in the produced output buffer not including the
578 OUT CHAR8
*StartOfBuffer
,
580 IN CONST CHAR8
*FormatString
,
585 Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated
586 ASCII format string and variable argument list.
588 Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer
590 The ASCII string is produced by parsing the format string specified by FormatString.
591 Arguments are pulled from the variable argument list based on the contents of the
593 The number of ASCII characters in the produced output buffer is returned not including
595 If BufferSize is 0, then no output buffer is produced and 0 is returned.
597 If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT().
598 If BufferSize > 0 and FormatString is NULL, then ASSERT().
599 If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than
600 PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator, then
602 If PcdMaximumAsciiStringLength is not zero, and produced Null-terminated ASCII string
603 contains more than PcdMaximumAsciiStringLength ASCII characters not including the
604 Null-terminator, then ASSERT().
606 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
608 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
609 @param FormatString Null-terminated ASCII format string.
610 @param ... Variable argument list whose contents are accessed based on the
611 format string specified by FormatString.
613 @return The number of ASCII characters in the produced output buffer not including the
620 OUT CHAR8
*StartOfBuffer
,
622 IN CONST CHAR8
*FormatString
,
627 Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated
628 Unicode format string and a VA_LIST argument list.
630 Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer
632 The ASCII string is produced by parsing the format string specified by FormatString.
633 Arguments are pulled from the variable argument list specified by Marker based on
634 the contents of the format string.
635 The number of ASCII characters in the produced output buffer is returned not including
637 If BufferSize is 0, then no output buffer is produced and 0 is returned.
639 If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT().
640 If BufferSize > 0 and FormatString is NULL, then ASSERT().
641 If BufferSize > 0 and FormatString is not aligned on a 16-bit boundary, then ASSERT().
642 If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than
643 PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then
645 If PcdMaximumAsciiStringLength is not zero, and produced Null-terminated ASCII string
646 contains more than PcdMaximumAsciiStringLength ASCII characters not including the
647 Null-terminator, then ASSERT().
649 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
651 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
652 @param FormatString Null-terminated Unicode format string.
653 @param Marker VA_LIST marker for the variable argument list.
655 @return The number of ASCII characters in the produced output buffer not including the
661 AsciiVSPrintUnicodeFormat (
662 OUT CHAR8
*StartOfBuffer
,
664 IN CONST CHAR16
*FormatString
,
669 Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated
670 Unicode format string and a BASE_LIST argument list.
672 Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer
674 The ASCII string is produced by parsing the format string specified by FormatString.
675 Arguments are pulled from the variable argument list specified by Marker based on
676 the contents of the format string.
677 The number of ASCII characters in the produced output buffer is returned not including
679 If BufferSize is 0, then no output buffer is produced and 0 is returned.
681 If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT().
682 If BufferSize > 0 and FormatString is NULL, then ASSERT().
683 If BufferSize > 0 and FormatString is not aligned on a 16-bit boundary, then ASSERT().
684 If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than
685 PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then
687 If PcdMaximumAsciiStringLength is not zero, and produced Null-terminated ASCII string
688 contains more than PcdMaximumAsciiStringLength ASCII characters not including the
689 Null-terminator, then ASSERT().
691 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
693 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
694 @param FormatString Null-terminated Unicode format string.
695 @param Marker BASE_LIST marker for the variable argument list.
697 @return The number of ASCII characters in the produced output buffer not including the
703 AsciiBSPrintUnicodeFormat (
704 OUT CHAR8
*StartOfBuffer
,
706 IN CONST CHAR16
*FormatString
,
711 Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated
712 Unicode format string and variable argument list.
714 Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer
716 The ASCII string is produced by parsing the format string specified by FormatString.
717 Arguments are pulled from the variable argument list based on the contents of the
719 The number of ASCII characters in the produced output buffer is returned not including
721 If BufferSize is 0, then no output buffer is produced and 0 is returned.
723 If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT().
724 If BufferSize > 0 and FormatString is NULL, then ASSERT().
725 If BufferSize > 0 and FormatString is not aligned on a 16-bit boundary, then ASSERT().
726 If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than
727 PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then
729 If PcdMaximumAsciiStringLength is not zero, and produced Null-terminated ASCII string
730 contains more than PcdMaximumAsciiStringLength ASCII characters not including the
731 Null-terminator, then ASSERT().
733 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
735 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
736 @param FormatString Null-terminated Unicode format string.
737 @param ... Variable argument list whose contents are accessed based on the
738 format string specified by FormatString.
740 @return The number of ASCII characters in the produced output buffer not including the
746 AsciiSPrintUnicodeFormat (
747 OUT CHAR8
*StartOfBuffer
,
749 IN CONST CHAR16
*FormatString
,
754 Converts a decimal value to a Null-terminated ASCII string.
756 Converts the decimal number specified by Value to a Null-terminated ASCII string
757 specified by Buffer containing at most Width characters. No padding of spaces
759 If Width is 0 then a width of MAXIMUM_VALUE_CHARACTERS is assumed.
760 The number of ASCII characters in Buffer is returned not including the Null-terminator.
761 If the conversion contains more than Width characters, then only the first Width
762 characters are returned, and the total number of characters required to perform
763 the conversion is returned.
764 Additional conversion parameters are specified in Flags.
765 The Flags bit LEFT_JUSTIFY is always ignored.
766 All conversions are left justified in Buffer.
767 If Width is 0, PREFIX_ZERO is ignored in Flags.
768 If COMMA_TYPE is set in Flags, then PREFIX_ZERO is ignored in Flags, and commas
769 are inserted every 3rd digit starting from the right.
770 If HEX_RADIX is set in Flags, then the output buffer will be
771 formatted in hexadecimal format.
772 If Value is < 0 and HEX_RADIX is not set in Flags, then the fist character in Buffer is a '-'.
773 If PREFIX_ZERO is set in Flags and PREFIX_ZERO is not being ignored,
774 then Buffer is padded with '0' characters so the combination of the optional '-'
775 sign character, '0' characters, digit characters for Value, and the Null-terminator
776 add up to Width characters.
778 If Buffer is NULL, then ASSERT().
779 If unsupported bits are set in Flags, then ASSERT().
780 If both COMMA_TYPE and HEX_RADIX are set in Flags, then ASSERT().
781 If Width >= MAXIMUM_VALUE_CHARACTERS, then ASSERT()
783 @param Buffer Pointer to the output buffer for the produced Null-terminated
785 @param Flags The bitmask of flags that specify left justification, zero pad, and commas.
786 @param Value The 64-bit signed value to convert to a string.
787 @param Width The maximum number of ASCII characters to place in Buffer, not including
790 @return The number of ASCII characters in Buffer not including the Null-terminator.