]>
git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BasePrintLib/PrintLib.c
2 Base Print Library instance implementation.
4 Copyright (c) 2006 - 2008, Intel Corporation<BR>
5 Portions copyright (c) 2008-2009 Apple Inc. All rights reserved.<BR>
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.
16 #include "PrintLibInternal.h"
19 // Declare a VA_LIST global variable that is used in calls to BasePrintLibSPrintMarker()
20 // when the BASE_LIST parameter is valid and the VA_LIST parameter is ignored.
21 // A NULL VA_LIST can not be passed into BasePrintLibSPrintMarker() because some
22 // compilers define VA_LIST to be a structure.
26 #define ASSERT_UNICODE_BUFFER(Buffer) ASSERT ((((UINTN) (Buffer)) & 0x01) == 0)
29 Produces a Null-terminated Unicode string in an output buffer based on
30 a Null-terminated Unicode format string and a VA_LIST argument list
32 Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer
34 The Unicode string is produced by parsing the format string specified by FormatString.
35 Arguments are pulled from the variable argument list specified by Marker based on the
36 contents of the format string.
37 The number of Unicode characters in the produced output buffer is returned not including
39 If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.
41 If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT().
42 If BufferSize > 1 and StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().
43 If BufferSize > 1 and FormatString is NULL, then ASSERT().
44 If BufferSize > 1 and FormatString is not aligned on a 16-bit boundary, then ASSERT().
45 If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than
46 PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then
48 If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string
49 contains more than PcdMaximumUnicodeStringLength Unicode characters not including the
50 Null-terminator, then ASSERT().
52 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
54 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
55 @param FormatString Null-terminated Unicode format string.
56 @param Marker VA_LIST marker for the variable argument list.
58 @return The number of Unicode characters in the produced output buffer not including the
65 OUT CHAR16
*StartOfBuffer
,
67 IN CONST CHAR16
*FormatString
,
71 ASSERT_UNICODE_BUFFER (StartOfBuffer
);
72 ASSERT_UNICODE_BUFFER (FormatString
);
73 return BasePrintLibSPrintMarker ((CHAR8
*)StartOfBuffer
, BufferSize
>> 1, FORMAT_UNICODE
| OUTPUT_UNICODE
, (CHAR8
*)FormatString
, Marker
, NULL
);
77 Produces a Null-terminated Unicode string in an output buffer based on
78 a Null-terminated Unicode format string and a BASE_LIST argument list
80 Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer
82 The Unicode string is produced by parsing the format string specified by FormatString.
83 Arguments are pulled from the variable argument list specified by Marker based on the
84 contents of the format string.
85 The number of Unicode characters in the produced output buffer is returned not including
87 If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.
89 If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT().
90 If BufferSize > 1 and StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().
91 If BufferSize > 1 and FormatString is NULL, then ASSERT().
92 If BufferSize > 1 and FormatString is not aligned on a 16-bit boundary, then ASSERT().
93 If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than
94 PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then
96 If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string
97 contains more than PcdMaximumUnicodeStringLength Unicode characters not including the
98 Null-terminator, then ASSERT().
100 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
102 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
103 @param FormatString Null-terminated Unicode format string.
104 @param Marker BASE_LIST marker for the variable argument list.
106 @return The number of Unicode characters in the produced output buffer not including the
113 OUT CHAR16
*StartOfBuffer
,
115 IN CONST CHAR16
*FormatString
,
119 ASSERT_UNICODE_BUFFER (StartOfBuffer
);
120 ASSERT_UNICODE_BUFFER (FormatString
);
121 return BasePrintLibSPrintMarker ((CHAR8
*)StartOfBuffer
, BufferSize
>> 1, FORMAT_UNICODE
| OUTPUT_UNICODE
, (CHAR8
*)FormatString
, gNullVaList
, Marker
);
125 Produces a Null-terminated Unicode string in an output buffer based on a Null-terminated
126 Unicode format string and variable argument list.
128 Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer
130 The Unicode string is produced by parsing the format string specified by FormatString.
131 Arguments are pulled from the variable argument list based on the contents of the format string.
132 The number of Unicode characters in the produced output buffer is returned not including
134 If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.
136 If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT().
137 If BufferSize > 1 and StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().
138 If BufferSize > 1 and FormatString is NULL, then ASSERT().
139 If BufferSize > 1 and FormatString is not aligned on a 16-bit boundary, then ASSERT().
140 If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than
141 PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then
143 If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string
144 contains more than PcdMaximumUnicodeStringLength Unicode characters not including the
145 Null-terminator, then ASSERT().
147 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
149 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
150 @param FormatString Null-terminated Unicode format string.
151 @param ... Variable argument list whose contents are accessed based on the
152 format string specified by FormatString.
154 @return The number of Unicode characters in the produced output buffer not including the
161 OUT CHAR16
*StartOfBuffer
,
163 IN CONST CHAR16
*FormatString
,
169 VA_START (Marker
, FormatString
);
170 return UnicodeVSPrint (StartOfBuffer
, BufferSize
, FormatString
, Marker
);
174 Produces a Null-terminated Unicode string in an output buffer based on a Null-terminated
175 ASCII format string and a VA_LIST argument list
177 Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer
179 The Unicode string is produced by parsing the format string specified by FormatString.
180 Arguments are pulled from the variable argument list specified by Marker based on the
181 contents of the format string.
182 The number of Unicode characters in the produced output buffer is returned not including
184 If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.
186 If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT().
187 If BufferSize > 1 and StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().
188 If BufferSize > 1 and FormatString is NULL, then ASSERT().
189 If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than
190 PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator, then
192 If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string
193 contains more than PcdMaximumUnicodeStringLength Unicode characters not including the
194 Null-terminator, then ASSERT().
196 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
198 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
199 @param FormatString Null-terminated ASCII format string.
200 @param Marker VA_LIST marker for the variable argument list.
202 @return The number of Unicode characters in the produced output buffer not including the
208 UnicodeVSPrintAsciiFormat (
209 OUT CHAR16
*StartOfBuffer
,
211 IN CONST CHAR8
*FormatString
,
215 ASSERT_UNICODE_BUFFER (StartOfBuffer
);
216 return BasePrintLibSPrintMarker ((CHAR8
*)StartOfBuffer
, BufferSize
>> 1, OUTPUT_UNICODE
, FormatString
, Marker
, NULL
);
220 Produces a Null-terminated Unicode string in an output buffer based on a Null-terminated
221 ASCII format string and a BASE_LIST argument list
223 Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer
225 The Unicode string is produced by parsing the format string specified by FormatString.
226 Arguments are pulled from the variable argument list specified by Marker based on the
227 contents of the format string.
228 The number of Unicode characters in the produced output buffer is returned not including
230 If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.
232 If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT().
233 If BufferSize > 1 and StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().
234 If BufferSize > 1 and FormatString is NULL, then ASSERT().
235 If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than
236 PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator, then
238 If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string
239 contains more than PcdMaximumUnicodeStringLength Unicode characters not including the
240 Null-terminator, then ASSERT().
242 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
244 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
245 @param FormatString Null-terminated ASCII format string.
246 @param Marker BASE_LIST marker for the variable argument list.
248 @return The number of Unicode characters in the produced output buffer not including the
254 UnicodeBSPrintAsciiFormat (
255 OUT CHAR16
*StartOfBuffer
,
257 IN CONST CHAR8
*FormatString
,
261 ASSERT_UNICODE_BUFFER (StartOfBuffer
);
262 return BasePrintLibSPrintMarker ((CHAR8
*)StartOfBuffer
, BufferSize
>> 1, OUTPUT_UNICODE
, FormatString
, gNullVaList
, Marker
);
266 Produces a Null-terminated Unicode string in an output buffer based on a Null-terminated
267 ASCII format string and variable argument list.
269 Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer
271 The Unicode string is produced by parsing the format string specified by FormatString.
272 Arguments are pulled from the variable argument list based on the contents of the
274 The number of Unicode characters in the produced output buffer is returned not including
276 If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.
278 If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT().
279 If BufferSize > 1 and StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().
280 If BufferSize > 1 and FormatString is NULL, then ASSERT().
281 If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than
282 PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator, then
284 If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string
285 contains more than PcdMaximumUnicodeStringLength Unicode characters not including the
286 Null-terminator, then ASSERT().
288 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
290 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
291 @param FormatString Null-terminated ASCII format string.
292 @param ... Variable argument list whose contents are accessed based on the
293 format string specified by FormatString.
295 @return The number of Unicode characters in the produced output buffer not including the
301 UnicodeSPrintAsciiFormat (
302 OUT CHAR16
*StartOfBuffer
,
304 IN CONST CHAR8
*FormatString
,
310 VA_START (Marker
, FormatString
);
311 return UnicodeVSPrintAsciiFormat (StartOfBuffer
, BufferSize
, FormatString
, Marker
);
315 Converts a decimal value to a Null-terminated Unicode string.
317 Converts the decimal number specified by Value to a Null-terminated Unicode
318 string specified by Buffer containing at most Width characters. No padding of spaces
319 is ever performed. If Width is 0 then a width of MAXIMUM_VALUE_CHARACTERS is assumed.
320 The number of Unicode characters in Buffer is returned not including the Null-terminator.
321 If the conversion contains more than Width characters, then only the first
322 Width characters are returned, and the total number of characters
323 required to perform the conversion is returned.
324 Additional conversion parameters are specified in Flags.
326 The Flags bit LEFT_JUSTIFY is always ignored.
327 All conversions are left justified in Buffer.
328 If Width is 0, PREFIX_ZERO is ignored in Flags.
329 If COMMA_TYPE is set in Flags, then PREFIX_ZERO is ignored in Flags, and commas
330 are inserted every 3rd digit starting from the right.
331 If HEX_RADIX is set in Flags, then the output buffer will be
332 formatted in hexadecimal format.
333 If Value is < 0 and HEX_RADIX is not set in Flags, then the fist character in Buffer is a '-'.
334 If PREFIX_ZERO is set in Flags and PREFIX_ZERO is not being ignored,
335 then Buffer is padded with '0' characters so the combination of the optional '-'
336 sign character, '0' characters, digit characters for Value, and the Null-terminator
337 add up to Width characters.
338 If both COMMA_TYPE and HEX_RADIX are set in Flags, then ASSERT().
339 If Buffer is NULL, then ASSERT().
340 If Buffer is not aligned on a 16-bit boundary, then ASSERT().
341 If unsupported bits are set in Flags, then ASSERT().
342 If both COMMA_TYPE and HEX_RADIX are set in Flags, then ASSERT().
343 If Width >= MAXIMUM_VALUE_CHARACTERS, then ASSERT()
345 @param Buffer Pointer to the output buffer for the produced Null-terminated
347 @param Flags The bitmask of flags that specify left justification, zero pad, and commas.
348 @param Value The 64-bit signed value to convert to a string.
349 @param Width The maximum number of Unicode characters to place in Buffer, not including
352 @return The number of Unicode characters in Buffer not including the Null-terminator.
357 UnicodeValueToString (
358 IN OUT CHAR16
*Buffer
,
364 ASSERT_UNICODE_BUFFER(Buffer
);
365 return BasePrintLibConvertValueToString ((CHAR8
*)Buffer
, Flags
, Value
, Width
, 2);
369 Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated
370 ASCII format string and a VA_LIST argument list.
372 Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer
374 The ASCII string is produced by parsing the format string specified by FormatString.
375 Arguments are pulled from the variable argument list specified by Marker based on
376 the contents of the format string.
377 The number of ASCII characters in the produced output buffer is returned not including
379 If BufferSize is 0, then no output buffer is produced and 0 is returned.
381 If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT().
382 If BufferSize > 0 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 PcdMaximumAsciiStringLength is not zero, and produced Null-terminated ASCII string
387 contains more than PcdMaximumAsciiStringLength ASCII 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 VA_LIST marker for the variable argument list.
396 @return The number of ASCII characters in the produced output buffer not including the
403 OUT CHAR8
*StartOfBuffer
,
405 IN CONST CHAR8
*FormatString
,
409 return BasePrintLibSPrintMarker (StartOfBuffer
, BufferSize
, 0, FormatString
, Marker
, NULL
);
413 Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated
414 ASCII format string and a BASE_LIST argument list.
416 Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer
418 The ASCII string is produced by parsing the format string specified by FormatString.
419 Arguments are pulled from the variable argument list specified by Marker based on
420 the contents of the format string.
421 The number of ASCII characters in the produced output buffer is returned not including
423 If BufferSize is 0, then no output buffer is produced and 0 is returned.
425 If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT().
426 If BufferSize > 0 and FormatString is NULL, then ASSERT().
427 If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than
428 PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator, then
430 If PcdMaximumAsciiStringLength is not zero, and produced Null-terminated ASCII string
431 contains more than PcdMaximumAsciiStringLength ASCII characters not including the
432 Null-terminator, then ASSERT().
434 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
436 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
437 @param FormatString Null-terminated ASCII format string.
438 @param Marker BASE_LIST marker for the variable argument list.
440 @return The number of ASCII characters in the produced output buffer not including the
447 OUT CHAR8
*StartOfBuffer
,
449 IN CONST CHAR8
*FormatString
,
453 return BasePrintLibSPrintMarker (StartOfBuffer
, BufferSize
, 0, FormatString
, gNullVaList
, Marker
);
457 Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated
458 ASCII format string and variable argument list.
460 Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer
462 The ASCII string is produced by parsing the format string specified by FormatString.
463 Arguments are pulled from the variable argument list based on the contents of the
465 The number of ASCII characters in the produced output buffer is returned not including
467 If BufferSize is 0, then no output buffer is produced and 0 is returned.
469 If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT().
470 If BufferSize > 0 and FormatString is NULL, then ASSERT().
471 If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than
472 PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator, then
474 If PcdMaximumAsciiStringLength is not zero, and produced Null-terminated ASCII string
475 contains more than PcdMaximumAsciiStringLength ASCII characters not including the
476 Null-terminator, then ASSERT().
478 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
480 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
481 @param FormatString Null-terminated ASCII format string.
482 @param ... Variable argument list whose contents are accessed based on the
483 format string specified by FormatString.
485 @return The number of ASCII characters in the produced output buffer not including the
492 OUT CHAR8
*StartOfBuffer
,
494 IN CONST CHAR8
*FormatString
,
500 VA_START (Marker
, FormatString
);
501 return AsciiVSPrint (StartOfBuffer
, BufferSize
, FormatString
, Marker
);
505 Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated
506 Unicode format string and a VA_LIST argument list.
508 Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer
510 The ASCII string is produced by parsing the format string specified by FormatString.
511 Arguments are pulled from the variable argument list specified by Marker based on
512 the contents of the format string.
513 The number of ASCII characters in the produced output buffer is returned not including
515 If BufferSize is 0, then no output buffer is produced and 0 is returned.
517 If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT().
518 If BufferSize > 0 and FormatString is NULL, then ASSERT().
519 If BufferSize > 0 and FormatString is not aligned on a 16-bit boundary, then ASSERT().
520 If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than
521 PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then
523 If PcdMaximumAsciiStringLength is not zero, and produced Null-terminated ASCII string
524 contains more than PcdMaximumAsciiStringLength ASCII characters not including the
525 Null-terminator, then ASSERT().
527 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
529 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
530 @param FormatString Null-terminated Unicode format string.
531 @param Marker VA_LIST marker for the variable argument list.
533 @return The number of ASCII characters in the produced output buffer not including the
539 AsciiVSPrintUnicodeFormat (
540 OUT CHAR8
*StartOfBuffer
,
542 IN CONST CHAR16
*FormatString
,
546 ASSERT_UNICODE_BUFFER (FormatString
);
547 return BasePrintLibSPrintMarker (StartOfBuffer
, BufferSize
, FORMAT_UNICODE
, (CHAR8
*)FormatString
, Marker
, NULL
);
551 Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated
552 Unicode format string and a BASE_LIST argument list.
554 Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer
556 The ASCII string is produced by parsing the format string specified by FormatString.
557 Arguments are pulled from the variable argument list specified by Marker based on
558 the contents of the format string.
559 The number of ASCII characters in the produced output buffer is returned not including
561 If BufferSize is 0, then no output buffer is produced and 0 is returned.
563 If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT().
564 If BufferSize > 0 and FormatString is NULL, then ASSERT().
565 If BufferSize > 0 and FormatString is not aligned on a 16-bit boundary, then ASSERT().
566 If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than
567 PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then
569 If PcdMaximumAsciiStringLength is not zero, and produced Null-terminated ASCII string
570 contains more than PcdMaximumAsciiStringLength ASCII characters not including the
571 Null-terminator, then ASSERT().
573 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
575 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
576 @param FormatString Null-terminated Unicode format string.
577 @param Marker BASE_LIST marker for the variable argument list.
579 @return The number of ASCII characters in the produced output buffer not including the
585 AsciiBSPrintUnicodeFormat (
586 OUT CHAR8
*StartOfBuffer
,
588 IN CONST CHAR16
*FormatString
,
592 ASSERT_UNICODE_BUFFER (FormatString
);
593 return BasePrintLibSPrintMarker (StartOfBuffer
, BufferSize
, FORMAT_UNICODE
, (CHAR8
*)FormatString
, gNullVaList
, Marker
);
597 Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated
598 Unicode format string and variable argument list.
600 Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer
602 The ASCII string is produced by parsing the format string specified by FormatString.
603 Arguments are pulled from the variable argument list based on the contents of the
605 The number of ASCII characters in the produced output buffer is returned not including
607 If BufferSize is 0, then no output buffer is produced and 0 is returned.
609 If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT().
610 If BufferSize > 0 and FormatString is NULL, then ASSERT().
611 If BufferSize > 0 and FormatString is not aligned on a 16-bit boundary, then ASSERT().
612 If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than
613 PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then
615 If PcdMaximumAsciiStringLength is not zero, and produced Null-terminated ASCII string
616 contains more than PcdMaximumAsciiStringLength ASCII characters not including the
617 Null-terminator, then ASSERT().
619 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
621 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
622 @param FormatString Null-terminated Unicode format string.
623 @param ... Variable argument list whose contents are accessed based on the
624 format string specified by FormatString.
626 @return The number of ASCII characters in the produced output buffer not including the
632 AsciiSPrintUnicodeFormat (
633 OUT CHAR8
*StartOfBuffer
,
635 IN CONST CHAR16
*FormatString
,
641 VA_START (Marker
, FormatString
);
642 return AsciiVSPrintUnicodeFormat (StartOfBuffer
, BufferSize
, FormatString
, Marker
);
647 Converts a decimal value to a Null-terminated ASCII string.
649 Converts the decimal number specified by Value to a Null-terminated ASCII string
650 specified by Buffer containing at most Width characters. No padding of spaces
652 If Width is 0 then a width of MAXIMUM_VALUE_CHARACTERS is assumed.
653 The number of ASCII characters in Buffer is returned not including the Null-terminator.
654 If the conversion contains more than Width characters, then only the first Width
655 characters are returned, and the total number of characters required to perform
656 the conversion is returned.
657 Additional conversion parameters are specified in Flags.
658 The Flags bit LEFT_JUSTIFY is always ignored.
659 All conversions are left justified in Buffer.
660 If Width is 0, PREFIX_ZERO is ignored in Flags.
661 If COMMA_TYPE is set in Flags, then PREFIX_ZERO is ignored in Flags, and commas
662 are inserted every 3rd digit starting from the right.
663 If HEX_RADIX is set in Flags, then the output buffer will be
664 formatted in hexadecimal format.
665 If Value is < 0 and HEX_RADIX is not set in Flags, then the fist character in Buffer is a '-'.
666 If PREFIX_ZERO is set in Flags and PREFIX_ZERO is not being ignored,
667 then Buffer is padded with '0' characters so the combination of the optional '-'
668 sign character, '0' characters, digit characters for Value, and the Null-terminator
669 add up to Width characters.
671 If Buffer is NULL, then ASSERT().
672 If unsupported bits are set in Flags, then ASSERT().
673 If both COMMA_TYPE and HEX_RADIX are set in Flags, then ASSERT().
674 If Width >= MAXIMUM_VALUE_CHARACTERS, then ASSERT()
676 @param Buffer Pointer to the output buffer for the produced Null-terminated
678 @param Flags The bitmask of flags that specify left justification, zero pad, and commas.
679 @param Value The 64-bit signed value to convert to a string.
680 @param Width The maximum number of ASCII characters to place in Buffer, not including
683 @return The number of ASCII characters in Buffer not including the Null-terminator.
695 return BasePrintLibConvertValueToString (Buffer
, Flags
, Value
, Width
, 1);