]>
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 - 2015, Intel Corporation. All rights reserved.<BR>
6 This program and the accompanying materials are licensed and made available under
7 the terms and conditions of the BSD License that accompanies this distribution.
8 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. The following end of line(EOL)
19 translations must be performed on the contents of the format string:
21 - '\\r' is translated to '\\r'
22 - '\\r\\n' is translated to '\\r\\n'
23 - '\\n' is translated to '\\r\\n'
24 - '\\n\\r' is translated to '\\r\\n'
26 This does not follow the ANSI C standard for sprint(). The format of argument
27 descriptors is described below. The ANSI C standard for sprint() has been
28 followed for some of the format types, and has not been followed for others.
29 The exceptions are noted below.
31 %[flags][width][.precision]type
35 - The field is left justified. If not flag is not specified, then the
36 field is right justified.
38 - Prefix a space character to a number. Only valid for types X, x, and d.
40 - Prefix a plus character to a number. Only valid for types X, x, and d.
41 If both space and + are specified, then space is ignored.
43 - Pad with 0 characters to the left of a number. Only valid for types
46 - Place a comma every 3rd digit of the number. Only valid for type d.
47 If 0 is also specified, then 0 is ignored.
49 - The number being printed is size UINT64. Only valid for types X, x, and d.
50 If this flag is not specified, then the number being printed is size int.
51 - NOTE: All invalid flags are ignored.
56 - The width of the field is specified by a UINTN argument in the
59 - The number specified as a decimal value represents the width of
61 - NOTE: If [width] is not specified, then a field width of 0 is assumed.
66 - The precision of the field is specified by a UINTN argument in the
69 - The number specified as a decimal value represents the precision of
71 - NOTE: If [.precision] is not specified, then a precision of 0 is assumed.
78 - The argument is a Unicode character. ASCII characters can be printed
79 using this type too by making sure bits 8..15 of the argument are set to 0.
81 - The argument is an unsigned hexadecimal number. The characters used are 0..9 and
82 A..F. If the flag 'L' is not specified, then the argument is assumed
83 to be size int. This does not follow ANSI C.
85 - The argument is an unsigned hexadecimal number and the number is padded with
86 zeros. This is equivalent to a format string of "0x". If the flag
87 'L' is not specified, then the argument is assumed to be size int.
88 This does not follow ANSI C.
90 - The argument is a signed decimal number. If the flag 'L' is not specified,
91 then the argument is assumed to be size int.
93 - The argument is a unsigned decimal number. If the flag 'L' is not specified,
94 then the argument is assumed to be size int.
96 - The argument is a pointer that is a (VOID *), and it is printed as an
97 unsigned hexadecimal number The characters used are 0..9 and A..F.
99 - The argument is a pointer to an ASCII string.
100 This does not follow ANSI C.
102 - The argument is a pointer to a Unicode string.
103 This does not follow ANSI C.
105 - The argument is a pointer to a GUID structure. The GUID is printed
106 in the format XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX.
107 This does not follow ANSI C.
109 - The argument is a pointer to an EFI_TIME structure. The time and
110 date are printed in the format "mm/dd/yyyy hh:mm" where mm is the
111 month zero padded, dd is the day zero padded, yyyy is the year zero
112 padded, hh is the hour zero padded, and mm is minutes zero padded.
113 This does not follow ANSI C.
115 - The argument is a RETURN_STATUS value. This value is converted to
116 a string following the table below. This does not follow ANSI C.
121 - RETURN_INVALID_PARAMETER
122 - "Invalid Parameter"
125 - RETURN_BAD_BUFFER_SIZE
127 - RETURN_BUFFER_TOO_SMALL
131 - RETURN_DEVICE_ERROR
133 - RETURN_WRITE_PROTECTED
135 - RETURN_OUT_OF_RESOURCES
137 - RETURN_VOLUME_CORRUPTED
143 - RETURN_MEDIA_CHANGED
147 - RETURN_ACCESS_DENIED
157 - RETURN_ALREADY_STARTED
165 - RETURN_PROTOCOL_ERROR
167 - RETURN_WARN_UNKNOWN_GLYPH
168 - "Warning Unknown Glyph"
169 - RETURN_WARN_DELETE_FAILURE
170 - "Warning Delete Failure"
171 - RETURN_WARN_WRITE_FAILURE
172 - "Warning Write Failure"
173 - RETURN_WARN_BUFFER_TOO_SMALL
174 - "Warning Buffer Too Small"
178 #ifndef __PRINT_LIB_H__
179 #define __PRINT_LIB_H__
182 /// Define the maximum number of characters that are required to
183 /// encode with a NULL terminator a decimal, hexadecimal, GUID,
186 /// Maximum Length Decimal String = 28
187 /// "-9,223,372,036,854,775,808"
188 /// Maximum Length Hexadecimal String = 17
189 /// "FFFFFFFFFFFFFFFF"
190 /// Maximum Length GUID = 37
191 /// "00000000-0000-0000-0000-000000000000"
192 /// Maximum Length TIME = 18
193 /// "12/12/2006 12:12"
195 #define MAXIMUM_VALUE_CHARACTERS 38
198 /// Flags bitmask values use in UnicodeValueToString() and
199 /// AsciiValueToString()
201 #define LEFT_JUSTIFY 0x01
202 #define COMMA_TYPE 0x08
203 #define PREFIX_ZERO 0x20
204 #define RADIX_HEX 0x80
207 Produces a Null-terminated Unicode string in an output buffer based on
208 a Null-terminated Unicode format string and a VA_LIST argument list.
210 Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer
212 The Unicode string is produced by parsing the format string specified by FormatString.
213 Arguments are pulled from the variable argument list specified by Marker based on the
214 contents of the format string.
215 The number of Unicode characters in the produced output buffer is returned, not including
217 If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.
219 If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT().
220 If BufferSize > 1 and StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().
221 If BufferSize > 1 and FormatString is NULL, then ASSERT().
222 If BufferSize > 1 and FormatString is not aligned on a 16-bit boundary, then ASSERT().
223 If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than
224 PcdMaximumUnicodeStringLength Unicode characters, not including the Null-terminator, then
226 If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string
227 contains more than PcdMaximumUnicodeStringLength Unicode characters, not including the
228 Null-terminator, then ASSERT().
230 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
232 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
233 @param FormatString Null-terminated Unicode format string.
234 @param Marker VA_LIST marker for the variable argument list.
236 @return The number of Unicode characters in the produced output buffer, not including the
243 OUT CHAR16
*StartOfBuffer
,
245 IN CONST CHAR16
*FormatString
,
250 Produces a Null-terminated Unicode string in an output buffer based on
251 a Null-terminated Unicode format string and a BASE_LIST argument list.
253 Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer
255 The Unicode string is produced by parsing the format string specified by FormatString.
256 Arguments are pulled from the variable argument list specified by Marker based on the
257 contents of the format string.
258 The number of Unicode characters in the produced output buffer is returned, not including
260 If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.
262 If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT().
263 If BufferSize > 1 and StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().
264 If BufferSize > 1 and FormatString is NULL, then ASSERT().
265 If BufferSize > 1 and FormatString is not aligned on a 16-bit boundary, then ASSERT().
266 If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than
267 PcdMaximumUnicodeStringLength Unicode characters, not including the Null-terminator, then
269 If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string
270 contains more than PcdMaximumUnicodeStringLength Unicode characters, not including the
271 Null-terminator, then ASSERT().
273 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
275 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
276 @param FormatString Null-terminated Unicode format string.
277 @param Marker BASE_LIST marker for the variable argument list.
279 @return The number of Unicode characters in the produced output buffer, not including the
286 OUT CHAR16
*StartOfBuffer
,
288 IN CONST CHAR16
*FormatString
,
293 Produces a Null-terminated Unicode string in an output buffer based on a Null-terminated
294 Unicode format string and variable argument list.
296 Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer
298 The Unicode string is produced by parsing the format string specified by FormatString.
299 Arguments are pulled from the variable argument list based on the contents of the format string.
300 The number of Unicode characters in the produced output buffer is returned, not including
302 If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.
304 If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT().
305 If BufferSize > 1 and StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().
306 If BufferSize > 1 and FormatString is NULL, then ASSERT().
307 If BufferSize > 1 and FormatString is not aligned on a 16-bit boundary, then ASSERT().
308 If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than
309 PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then
311 If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string
312 contains more than PcdMaximumUnicodeStringLength Unicode characters not including the
313 Null-terminator, then ASSERT().
315 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
317 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
318 @param FormatString A null-terminated Unicode format string.
319 @param ... The variable argument list whose contents are accessed based on the
320 format string specified by FormatString.
322 @return The number of Unicode characters in the produced output buffer, not including the
329 OUT CHAR16
*StartOfBuffer
,
331 IN CONST CHAR16
*FormatString
,
336 Produces a Null-terminated Unicode string in an output buffer based on a Null-terminated
337 ASCII format string and a VA_LIST argument list
339 Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer
341 The Unicode string is produced by parsing the format string specified by FormatString.
342 Arguments are pulled from the variable argument list specified by Marker based on the
343 contents of the format string.
344 The number of Unicode characters in the produced output buffer is returned, not including
346 If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.
348 If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT().
349 If BufferSize > 1 and StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().
350 If BufferSize > 1 and FormatString is NULL, then ASSERT().
351 If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than
352 PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator, then
354 If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string
355 contains more than PcdMaximumUnicodeStringLength Unicode characters, not including the
356 Null-terminator, then ASSERT().
358 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
360 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
361 @param FormatString A null-terminated ASCII format string.
362 @param Marker VA_LIST marker for the variable argument list.
364 @return The number of Unicode characters in the produced output buffer not including the
370 UnicodeVSPrintAsciiFormat (
371 OUT CHAR16
*StartOfBuffer
,
373 IN CONST CHAR8
*FormatString
,
378 Produces a Null-terminated Unicode string in an output buffer based on a Null-terminated
379 ASCII format string and a BASE_LIST argument list
381 Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer
383 The Unicode string is produced by parsing the format string specified by FormatString.
384 Arguments are pulled from the variable argument list specified by Marker based on the
385 contents of the format string.
386 The number of Unicode characters in the produced output buffer is returned, not including
388 If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.
390 If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT().
391 If BufferSize > 1 and StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().
392 If BufferSize > 1 and FormatString is NULL, then ASSERT().
393 If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than
394 PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator, then
396 If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string
397 contains more than PcdMaximumUnicodeStringLength Unicode characters, not including the
398 Null-terminator, then ASSERT().
400 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
402 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
403 @param FormatString A null-terminated ASCII format string.
404 @param Marker A BASE_LIST marker for the variable argument list.
406 @return The number of Unicode characters in the produced output buffer, not including the
412 UnicodeBSPrintAsciiFormat (
413 OUT CHAR16
*StartOfBuffer
,
415 IN CONST CHAR8
*FormatString
,
420 Produces a Null-terminated Unicode string in an output buffer based on a Null-terminated
421 ASCII format string and variable argument list.
423 Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer
425 The Unicode string is produced by parsing the format string specified by FormatString.
426 Arguments are pulled from the variable argument list based on the contents of the
428 The number of Unicode characters in the produced output buffer is returned, not including
430 If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.
432 If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT().
433 If BufferSize > 1 and StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().
434 If BufferSize > 1 and FormatString is NULL, then ASSERT().
435 If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than
436 PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator, then
438 If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string
439 contains more than PcdMaximumUnicodeStringLength Unicode characters, the
440 Null-terminator, then ASSERT().
442 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
444 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
445 @param FormatString A null-terminated ASCII format string.
446 @param ... Variable argument list whose contents are accessed based on the
447 format string specified by FormatString.
449 @return The number of Unicode characters in the produced output buffer, not including the
455 UnicodeSPrintAsciiFormat (
456 OUT CHAR16
*StartOfBuffer
,
458 IN CONST CHAR8
*FormatString
,
463 Converts a decimal value to a Null-terminated Unicode string.
465 Converts the decimal number specified by Value to a Null-terminated Unicode
466 string specified by Buffer containing at most Width characters. No padding of spaces
467 is ever performed. If Width is 0 then a width of MAXIMUM_VALUE_CHARACTERS is assumed.
468 The number of Unicode characters in Buffer is returned, not including the Null-terminator.
469 If the conversion contains more than Width characters, then only the first
470 Width characters are returned, and the total number of characters
471 required to perform the conversion is returned.
472 Additional conversion parameters are specified in Flags.
474 The Flags bit LEFT_JUSTIFY is always ignored.
475 All conversions are left justified in Buffer.
476 If Width is 0, PREFIX_ZERO is ignored in Flags.
477 If COMMA_TYPE is set in Flags, then PREFIX_ZERO is ignored in Flags, and commas
478 are inserted every 3rd digit starting from the right.
479 If RADIX_HEX is set in Flags, then the output buffer will be
480 formatted in hexadecimal format.
481 If Value is < 0 and RADIX_HEX is not set in Flags, then the fist character in Buffer is a '-'.
482 If PREFIX_ZERO is set in Flags and PREFIX_ZERO is not being ignored,
483 then Buffer is padded with '0' characters so the combination of the optional '-'
484 sign character, '0' characters, digit characters for Value, and the Null-terminator
485 add up to Width characters.
486 If both COMMA_TYPE and RADIX_HEX are set in Flags, then ASSERT().
487 If Buffer is NULL, then ASSERT().
488 If Buffer is not aligned on a 16-bit boundary, then ASSERT().
489 If unsupported bits are set in Flags, then ASSERT().
490 If both COMMA_TYPE and RADIX_HEX are set in Flags, then ASSERT().
491 If Width >= MAXIMUM_VALUE_CHARACTERS, then ASSERT()
493 @param Buffer The pointer to the output buffer for the produced Null-terminated
495 @param Flags The bitmask of flags that specify left justification, zero pad, and commas.
496 @param Value The 64-bit signed value to convert to a string.
497 @param Width The maximum number of Unicode characters to place in Buffer, not including
500 @return The number of Unicode characters in Buffer, not including the Null-terminator.
505 UnicodeValueToString (
506 IN OUT CHAR16
*Buffer
,
513 Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated
514 ASCII format string and a VA_LIST argument list.
516 Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer
518 The ASCII string is produced by parsing the format string specified by FormatString.
519 Arguments are pulled from the variable argument list specified by Marker based on
520 the contents of the format string.
521 The number of ASCII characters in the produced output buffer is returned, not including
523 If BufferSize is 0, then no output buffer is produced and 0 is returned.
525 If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT().
526 If BufferSize > 0 and FormatString is NULL, then ASSERT().
527 If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than
528 PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator, then
530 If PcdMaximumAsciiStringLength is not zero, and produced Null-terminated ASCII string
531 contains more than PcdMaximumAsciiStringLength ASCII characters, not including the
532 Null-terminator, then ASSERT().
534 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
536 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
537 @param FormatString A null-terminated ASCII format string.
538 @param Marker VA_LIST marker for the variable argument list.
540 @return The number of ASCII characters in the produced output buffer, not including the
547 OUT CHAR8
*StartOfBuffer
,
549 IN CONST CHAR8
*FormatString
,
554 Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated
555 ASCII format string and a BASE_LIST argument list.
557 Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer
559 The ASCII string is produced by parsing the format string specified by FormatString.
560 Arguments are pulled from the variable argument list specified by Marker based on
561 the contents of the format string.
562 The number of ASCII characters in the produced output buffer is returned, not including
564 If BufferSize is 0, then no output buffer is produced and 0 is returned.
566 If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT().
567 If BufferSize > 0 and FormatString is NULL, then ASSERT().
568 If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than
569 PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator, then
571 If PcdMaximumAsciiStringLength is not zero, and produced Null-terminated ASCII string
572 contains more than PcdMaximumAsciiStringLength ASCII characters, not including the
573 Null-terminator, then ASSERT().
575 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
577 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
578 @param FormatString A null-terminated ASCII format string.
579 @param Marker BASE_LIST marker for the variable argument list.
581 @return The number of ASCII characters in the produced output buffer, not including the
588 OUT CHAR8
*StartOfBuffer
,
590 IN CONST CHAR8
*FormatString
,
595 Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated
596 ASCII format string and variable argument list.
598 Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer
600 The ASCII string is produced by parsing the format string specified by FormatString.
601 Arguments are pulled from the variable argument list based on the contents of the
603 The number of ASCII characters in the produced output buffer is returned, not including
605 If BufferSize is 0, then no output buffer is produced and 0 is returned.
607 If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT().
608 If BufferSize > 0 and FormatString is NULL, then ASSERT().
609 If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than
610 PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator, then
612 If PcdMaximumAsciiStringLength is not zero, and produced Null-terminated ASCII string
613 contains more than PcdMaximumAsciiStringLength ASCII characters, not including the
614 Null-terminator, then ASSERT().
616 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
618 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
619 @param FormatString A null-terminated ASCII format string.
620 @param ... The variable argument list whose contents are accessed based on the
621 format string specified by FormatString.
623 @return The number of ASCII characters in the produced output buffer, not including the
630 OUT CHAR8
*StartOfBuffer
,
632 IN CONST CHAR8
*FormatString
,
637 Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated
638 Unicode format string and a VA_LIST argument list.
640 Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer
642 The ASCII string is produced by parsing the format string specified by FormatString.
643 Arguments are pulled from the variable argument list specified by Marker based on
644 the contents of the format string.
645 The number of ASCII characters in the produced output buffer is returned, not including
647 If BufferSize is 0, then no output buffer is produced and 0 is returned.
649 If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT().
650 If BufferSize > 0 and FormatString is NULL, then ASSERT().
651 If BufferSize > 0 and FormatString is not aligned on a 16-bit boundary, then ASSERT().
652 If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than
653 PcdMaximumUnicodeStringLength Unicode characters, not including the Null-terminator, then
655 If PcdMaximumAsciiStringLength is not zero, and produced Null-terminated ASCII string
656 contains more than PcdMaximumAsciiStringLength ASCII characters, not including the
657 Null-terminator, then ASSERT().
659 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
661 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
662 @param FormatString A null-terminated Unicode format string.
663 @param Marker VA_LIST marker for the variable argument list.
665 @return The number of ASCII characters in the produced output buffer, not including the
671 AsciiVSPrintUnicodeFormat (
672 OUT CHAR8
*StartOfBuffer
,
674 IN CONST CHAR16
*FormatString
,
679 Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated
680 Unicode format string and a BASE_LIST argument list.
682 Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer
684 The ASCII string is produced by parsing the format string specified by FormatString.
685 Arguments are pulled from the variable argument list specified by Marker based on
686 the contents of the format string.
687 The number of ASCII characters in the produced output buffer is returned, not including
689 If BufferSize is 0, then no output buffer is produced and 0 is returned.
691 If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT().
692 If BufferSize > 0 and FormatString is NULL, then ASSERT().
693 If BufferSize > 0 and FormatString is not aligned on a 16-bit boundary, then ASSERT().
694 If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than
695 PcdMaximumUnicodeStringLength Unicode characters, not including the Null-terminator, then
697 If PcdMaximumAsciiStringLength is not zero, and produced Null-terminated ASCII string
698 contains more than PcdMaximumAsciiStringLength ASCII characters, not including the
699 Null-terminator, then ASSERT().
701 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
703 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
704 @param FormatString A null-terminated Unicode format string.
705 @param Marker BASE_LIST marker for the variable argument list.
707 @return The number of ASCII characters in the produced output buffer, not including the
713 AsciiBSPrintUnicodeFormat (
714 OUT CHAR8
*StartOfBuffer
,
716 IN CONST CHAR16
*FormatString
,
721 Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated
722 Unicode format string and variable argument list.
724 Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer
726 The ASCII string is produced by parsing the format string specified by FormatString.
727 Arguments are pulled from the variable argument list based on the contents of the
729 The number of ASCII characters in the produced output buffer is returned, not including
731 If BufferSize is 0, then no output buffer is produced and 0 is returned.
733 If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT().
734 If BufferSize > 0 and FormatString is NULL, then ASSERT().
735 If BufferSize > 0 and FormatString is not aligned on a 16-bit boundary, then ASSERT().
736 If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than
737 PcdMaximumUnicodeStringLength Unicode characters, not including the Null-terminator, then
739 If PcdMaximumAsciiStringLength is not zero, and produced Null-terminated ASCII string
740 contains more than PcdMaximumAsciiStringLength ASCII characters, not including the
741 Null-terminator, then ASSERT().
743 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
745 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
746 @param FormatString A null-terminated Unicode format string.
747 @param ... Variable argument list whose contents are accessed based on the
748 format string specified by FormatString.
750 @return The number of ASCII characters in the produced output buffer, not including the
756 AsciiSPrintUnicodeFormat (
757 OUT CHAR8
*StartOfBuffer
,
759 IN CONST CHAR16
*FormatString
,
764 Converts a decimal value to a Null-terminated ASCII string.
766 Converts the decimal number specified by Value to a Null-terminated ASCII string
767 specified by Buffer containing at most Width characters. No padding of spaces
769 If Width is 0 then a width of MAXIMUM_VALUE_CHARACTERS is assumed.
770 The number of ASCII characters in Buffer is returned, not including the Null-terminator.
771 If the conversion contains more than Width characters, then only the first Width
772 characters are returned, and the total number of characters required to perform
773 the conversion is returned.
774 Additional conversion parameters are specified in Flags.
775 The Flags bit LEFT_JUSTIFY is always ignored.
776 All conversions are left justified in Buffer.
777 If Width is 0, PREFIX_ZERO is ignored in Flags.
778 If COMMA_TYPE is set in Flags, then PREFIX_ZERO is ignored in Flags, and commas
779 are inserted every 3rd digit starting from the right.
780 If RADIX_HEX is set in Flags, then the output buffer will be
781 formatted in hexadecimal format.
782 If Value is < 0 and RADIX_HEX is not set in Flags, then the fist character in Buffer is a '-'.
783 If PREFIX_ZERO is set in Flags and PREFIX_ZERO is not being ignored,
784 then Buffer is padded with '0' characters so the combination of the optional '-'
785 sign character, '0' characters, digit characters for Value, and the Null-terminator
786 add up to Width characters.
788 If Buffer is NULL, then ASSERT().
789 If unsupported bits are set in Flags, then ASSERT().
790 If both COMMA_TYPE and RADIX_HEX are set in Flags, then ASSERT().
791 If Width >= MAXIMUM_VALUE_CHARACTERS, then ASSERT()
793 @param Buffer A pointer to the output buffer for the produced Null-terminated
795 @param Flags The bitmask of flags that specify left justification, zero pad, and commas.
796 @param Value The 64-bit signed value to convert to a string.
797 @param Width The maximum number of ASCII characters to place in Buffer, not including
800 @return The number of ASCII characters in Buffer, not including the Null-terminator.
813 Returns the number of characters that would be produced by if the formatted
814 output were produced not including the Null-terminator.
816 If Format is NULL, then ASSERT().
817 If Format is not aligned on a 16-bit boundary, then ASSERT().
819 @param[in] FormatString A Null-terminated Unicode format string.
820 @param[in] Marker VA_LIST marker for the variable argument list.
822 @return The number of characters that would be produced, not including the
828 IN CONST CHAR16
*FormatString
,
833 Returns the number of characters that would be produced by if the formatted
834 output were produced not including the Null-terminator.
836 If Format is NULL, then ASSERT().
838 @param[in] FormatString A Null-terminated ASCII format string.
839 @param[in] Marker VA_LIST marker for the variable argument list.
841 @return The number of characters that would be produced, not including the
846 SPrintLengthAsciiFormat (
847 IN CONST CHAR8
*FormatString
,