2 Base Print Library instance implementation.
4 Copyright (c) 2006 - 2008, Intel Corporation<BR>
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 #include "PrintLibInternal.h"
17 #define ASSERT_UNICODE_BUFFER(Buffer) ASSERT ((((UINTN) (Buffer)) & 0x01) == 0)
20 Produces a Null-terminated Unicode string in an output buffer based on
21 a Null-terminated Unicode format string and a VA_LIST argument list
23 Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer
25 The Unicode string is produced by parsing the format string specified by FormatString.
26 Arguments are pulled from the variable argument list specified by Marker based on the
27 contents of the format string.
28 The number of Unicode characters in the produced output buffer is returned not including
30 If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.
32 If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT().
33 If BufferSize > 1 and StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().
34 If BufferSize > 1 and FormatString is NULL, then ASSERT().
35 If BufferSize > 1 and FormatString is not aligned on a 16-bit boundary, then ASSERT().
36 If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than
37 PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then
39 If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string
40 contains more than PcdMaximumUnicodeStringLength Unicode characters not including the
41 Null-terminator, then ASSERT().
43 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
45 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
46 @param FormatString Null-terminated Unicode format string.
47 @param Marker VA_LIST marker for the variable argument list.
49 @return The number of Unicode characters in the produced output buffer not including the
56 OUT CHAR16
*StartOfBuffer
,
58 IN CONST CHAR16
*FormatString
,
62 ASSERT_UNICODE_BUFFER (StartOfBuffer
);
63 ASSERT_UNICODE_BUFFER (FormatString
);
64 return BasePrintLibSPrintMarker ((CHAR8
*)StartOfBuffer
, BufferSize
>> 1, FORMAT_UNICODE
| OUTPUT_UNICODE
, (CHAR8
*)FormatString
, Marker
, NULL
);
68 Produces a Null-terminated Unicode string in an output buffer based on
69 a Null-terminated Unicode format string and a BASE_LIST argument list
71 Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer
73 The Unicode string is produced by parsing the format string specified by FormatString.
74 Arguments are pulled from the variable argument list specified by Marker based on the
75 contents of the format string.
76 The number of Unicode characters in the produced output buffer is returned not including
78 If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.
80 If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT().
81 If BufferSize > 1 and StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().
82 If BufferSize > 1 and FormatString is NULL, then ASSERT().
83 If BufferSize > 1 and FormatString is not aligned on a 16-bit boundary, then ASSERT().
84 If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than
85 PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then
87 If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string
88 contains more than PcdMaximumUnicodeStringLength Unicode characters not including the
89 Null-terminator, then ASSERT().
91 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
93 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
94 @param FormatString Null-terminated Unicode format string.
95 @param Marker BASE_LIST marker for the variable argument list.
97 @return The number of Unicode characters in the produced output buffer not including the
104 OUT CHAR16
*StartOfBuffer
,
106 IN CONST CHAR16
*FormatString
,
110 ASSERT_UNICODE_BUFFER (StartOfBuffer
);
111 ASSERT_UNICODE_BUFFER (FormatString
);
112 return BasePrintLibSPrintMarker ((CHAR8
*)StartOfBuffer
, BufferSize
>> 1, FORMAT_UNICODE
| OUTPUT_UNICODE
, (CHAR8
*)FormatString
, NULL
, Marker
);
116 Produces a Null-terminated Unicode string in an output buffer based on a Null-terminated
117 Unicode format string and variable argument list.
119 Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer
121 The Unicode string is produced by parsing the format string specified by FormatString.
122 Arguments are pulled from the variable argument list based on the contents of the format string.
123 The number of Unicode characters in the produced output buffer is returned not including
125 If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.
127 If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT().
128 If BufferSize > 1 and StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().
129 If BufferSize > 1 and FormatString is NULL, then ASSERT().
130 If BufferSize > 1 and FormatString is not aligned on a 16-bit boundary, then ASSERT().
131 If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than
132 PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then
134 If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string
135 contains more than PcdMaximumUnicodeStringLength Unicode characters not including the
136 Null-terminator, then ASSERT().
138 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
140 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
141 @param FormatString Null-terminated Unicode format string.
142 @param ... Variable argument list whose contents are accessed based on the
143 format string specified by FormatString.
145 @return The number of Unicode characters in the produced output buffer not including the
152 OUT CHAR16
*StartOfBuffer
,
154 IN CONST CHAR16
*FormatString
,
160 VA_START (Marker
, FormatString
);
161 return UnicodeVSPrint (StartOfBuffer
, BufferSize
, FormatString
, Marker
);
165 Produces a Null-terminated Unicode string in an output buffer based on a Null-terminated
166 ASCII format string and a VA_LIST argument list
168 Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer
170 The Unicode string is produced by parsing the format string specified by FormatString.
171 Arguments are pulled from the variable argument list specified by Marker based on the
172 contents of the format string.
173 The number of Unicode characters in the produced output buffer is returned not including
175 If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.
177 If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT().
178 If BufferSize > 1 and StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().
179 If BufferSize > 1 and FormatString is NULL, then ASSERT().
180 If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than
181 PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator, then
183 If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string
184 contains more than PcdMaximumUnicodeStringLength Unicode characters not including the
185 Null-terminator, then ASSERT().
187 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
189 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
190 @param FormatString Null-terminated ASCII format string.
191 @param Marker VA_LIST marker for the variable argument list.
193 @return The number of Unicode characters in the produced output buffer not including the
199 UnicodeVSPrintAsciiFormat (
200 OUT CHAR16
*StartOfBuffer
,
202 IN CONST CHAR8
*FormatString
,
206 ASSERT_UNICODE_BUFFER (StartOfBuffer
);
207 return BasePrintLibSPrintMarker ((CHAR8
*)StartOfBuffer
, BufferSize
>> 1, OUTPUT_UNICODE
, FormatString
, Marker
, NULL
);
211 Produces a Null-terminated Unicode string in an output buffer based on a Null-terminated
212 ASCII format string and a BASE_LIST argument list
214 Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer
216 The Unicode string is produced by parsing the format string specified by FormatString.
217 Arguments are pulled from the variable argument list specified by Marker based on the
218 contents of the format string.
219 The number of Unicode characters in the produced output buffer is returned not including
221 If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.
223 If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT().
224 If BufferSize > 1 and StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().
225 If BufferSize > 1 and FormatString is NULL, then ASSERT().
226 If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than
227 PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator, then
229 If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string
230 contains more than PcdMaximumUnicodeStringLength Unicode characters not including the
231 Null-terminator, then ASSERT().
233 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
235 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
236 @param FormatString Null-terminated ASCII format string.
237 @param Marker BASE_LIST marker for the variable argument list.
239 @return The number of Unicode characters in the produced output buffer not including the
245 UnicodeBSPrintAsciiFormat (
246 OUT CHAR16
*StartOfBuffer
,
248 IN CONST CHAR8
*FormatString
,
252 ASSERT_UNICODE_BUFFER (StartOfBuffer
);
253 return BasePrintLibSPrintMarker ((CHAR8
*)StartOfBuffer
, BufferSize
>> 1, OUTPUT_UNICODE
, FormatString
, NULL
, Marker
);
257 Produces a Null-terminated Unicode string in an output buffer based on a Null-terminated
258 ASCII format string and variable argument list.
260 Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer
262 The Unicode string is produced by parsing the format string specified by FormatString.
263 Arguments are pulled from the variable argument list based on the contents of the
265 The number of Unicode characters in the produced output buffer is returned not including
267 If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.
269 If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT().
270 If BufferSize > 1 and StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().
271 If BufferSize > 1 and FormatString is NULL, then ASSERT().
272 If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than
273 PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator, then
275 If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string
276 contains more than PcdMaximumUnicodeStringLength Unicode characters not including the
277 Null-terminator, then ASSERT().
279 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
281 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
282 @param FormatString Null-terminated ASCII format string.
283 @param ... Variable argument list whose contents are accessed based on the
284 format string specified by FormatString.
286 @return The number of Unicode characters in the produced output buffer not including the
292 UnicodeSPrintAsciiFormat (
293 OUT CHAR16
*StartOfBuffer
,
295 IN CONST CHAR8
*FormatString
,
301 VA_START (Marker
, FormatString
);
302 return UnicodeVSPrintAsciiFormat (StartOfBuffer
, BufferSize
, FormatString
, Marker
);
306 Converts a decimal value to a Null-terminated Unicode string.
308 Converts the decimal number specified by Value to a Null-terminated Unicode
309 string specified by Buffer containing at most Width characters. No padding of spaces
310 is ever performed. If Width is 0 then a width of MAXIMUM_VALUE_CHARACTERS is assumed.
311 The number of Unicode characters in Buffer is returned not including the Null-terminator.
312 If the conversion contains more than Width characters, then only the first
313 Width characters are returned, and the total number of characters
314 required to perform the conversion is returned.
315 Additional conversion parameters are specified in Flags.
317 The Flags bit LEFT_JUSTIFY is always ignored.
318 All conversions are left justified in Buffer.
319 If Width is 0, PREFIX_ZERO is ignored in Flags.
320 If COMMA_TYPE is set in Flags, then PREFIX_ZERO is ignored in Flags, and commas
321 are inserted every 3rd digit starting from the right.
322 If HEX_RADIX is set in Flags, then the output buffer will be
323 formatted in hexadecimal format.
324 If Value is < 0 and HEX_RADIX is not set in Flags, then the fist character in Buffer is a '-'.
325 If PREFIX_ZERO is set in Flags and PREFIX_ZERO is not being ignored,
326 then Buffer is padded with '0' characters so the combination of the optional '-'
327 sign character, '0' characters, digit characters for Value, and the Null-terminator
328 add up to Width characters.
329 If both COMMA_TYPE and HEX_RADIX are set in Flags, then ASSERT().
330 If Buffer is NULL, then ASSERT().
331 If Buffer is not aligned on a 16-bit boundary, then ASSERT().
332 If unsupported bits are set in Flags, then ASSERT().
333 If both COMMA_TYPE and HEX_RADIX are set in Flags, then ASSERT().
334 If Width >= MAXIMUM_VALUE_CHARACTERS, then ASSERT()
336 @param Buffer Pointer to the output buffer for the produced Null-terminated
338 @param Flags The bitmask of flags that specify left justification, zero pad, and commas.
339 @param Value The 64-bit signed value to convert to a string.
340 @param Width The maximum number of Unicode characters to place in Buffer, not including
343 @return The number of Unicode characters in Buffer not including the Null-terminator.
348 UnicodeValueToString (
349 IN OUT CHAR16
*Buffer
,
355 ASSERT_UNICODE_BUFFER(Buffer
);
356 return BasePrintLibConvertValueToString ((CHAR8
*)Buffer
, Flags
, Value
, Width
, 2);
360 Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated
361 ASCII format string and a VA_LIST argument list.
363 Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer
365 The ASCII string is produced by parsing the format string specified by FormatString.
366 Arguments are pulled from the variable argument list specified by Marker based on
367 the contents of the format string.
368 The number of ASCII characters in the produced output buffer is returned not including
370 If BufferSize is 0, then no output buffer is produced and 0 is returned.
372 If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT().
373 If BufferSize > 0 and FormatString is NULL, then ASSERT().
374 If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than
375 PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator, then
377 If PcdMaximumAsciiStringLength is not zero, and produced Null-terminated ASCII string
378 contains more than PcdMaximumAsciiStringLength ASCII characters not including the
379 Null-terminator, then ASSERT().
381 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
383 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
384 @param FormatString Null-terminated ASCII format string.
385 @param Marker VA_LIST marker for the variable argument list.
387 @return The number of ASCII characters in the produced output buffer not including the
394 OUT CHAR8
*StartOfBuffer
,
396 IN CONST CHAR8
*FormatString
,
400 return BasePrintLibSPrintMarker (StartOfBuffer
, BufferSize
, 0, FormatString
, Marker
, NULL
);
404 Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated
405 ASCII format string and a BASE_LIST argument list.
407 Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer
409 The ASCII string is produced by parsing the format string specified by FormatString.
410 Arguments are pulled from the variable argument list specified by Marker based on
411 the contents of the format string.
412 The number of ASCII characters in the produced output buffer is returned not including
414 If BufferSize is 0, then no output buffer is produced and 0 is returned.
416 If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT().
417 If BufferSize > 0 and FormatString is NULL, then ASSERT().
418 If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than
419 PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator, then
421 If PcdMaximumAsciiStringLength is not zero, and produced Null-terminated ASCII string
422 contains more than PcdMaximumAsciiStringLength ASCII characters not including the
423 Null-terminator, then ASSERT().
425 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
427 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
428 @param FormatString Null-terminated ASCII format string.
429 @param Marker BASE_LIST marker for the variable argument list.
431 @return The number of ASCII characters in the produced output buffer not including the
438 OUT CHAR8
*StartOfBuffer
,
440 IN CONST CHAR8
*FormatString
,
444 return BasePrintLibSPrintMarker (StartOfBuffer
, BufferSize
, 0, FormatString
, NULL
, Marker
);
448 Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated
449 ASCII format string and variable argument list.
451 Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer
453 The ASCII string is produced by parsing the format string specified by FormatString.
454 Arguments are pulled from the variable argument list based on the contents of the
456 The number of ASCII characters in the produced output buffer is returned not including
458 If BufferSize is 0, then no output buffer is produced and 0 is returned.
460 If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT().
461 If BufferSize > 0 and FormatString is NULL, then ASSERT().
462 If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than
463 PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator, then
465 If PcdMaximumAsciiStringLength is not zero, and produced Null-terminated ASCII string
466 contains more than PcdMaximumAsciiStringLength ASCII characters not including the
467 Null-terminator, then ASSERT().
469 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
471 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
472 @param FormatString Null-terminated ASCII format string.
473 @param ... Variable argument list whose contents are accessed based on the
474 format string specified by FormatString.
476 @return The number of ASCII characters in the produced output buffer not including the
483 OUT CHAR8
*StartOfBuffer
,
485 IN CONST CHAR8
*FormatString
,
491 VA_START (Marker
, FormatString
);
492 return AsciiVSPrint (StartOfBuffer
, BufferSize
, FormatString
, Marker
);
496 Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated
497 Unicode format string and a VA_LIST argument list.
499 Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer
501 The ASCII string is produced by parsing the format string specified by FormatString.
502 Arguments are pulled from the variable argument list specified by Marker based on
503 the contents of the format string.
504 The number of ASCII characters in the produced output buffer is returned not including
506 If BufferSize is 0, then no output buffer is produced and 0 is returned.
508 If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT().
509 If BufferSize > 0 and FormatString is NULL, then ASSERT().
510 If BufferSize > 0 and FormatString is not aligned on a 16-bit boundary, then ASSERT().
511 If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than
512 PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then
514 If PcdMaximumAsciiStringLength is not zero, and produced Null-terminated ASCII string
515 contains more than PcdMaximumAsciiStringLength ASCII characters not including the
516 Null-terminator, then ASSERT().
518 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
520 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
521 @param FormatString Null-terminated Unicode format string.
522 @param Marker VA_LIST marker for the variable argument list.
524 @return The number of ASCII characters in the produced output buffer not including the
530 AsciiVSPrintUnicodeFormat (
531 OUT CHAR8
*StartOfBuffer
,
533 IN CONST CHAR16
*FormatString
,
537 ASSERT_UNICODE_BUFFER (FormatString
);
538 return BasePrintLibSPrintMarker (StartOfBuffer
, BufferSize
, FORMAT_UNICODE
, (CHAR8
*)FormatString
, Marker
, NULL
);
542 Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated
543 Unicode format string and a BASE_LIST argument list.
545 Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer
547 The ASCII string is produced by parsing the format string specified by FormatString.
548 Arguments are pulled from the variable argument list specified by Marker based on
549 the contents of the format string.
550 The number of ASCII characters in the produced output buffer is returned not including
552 If BufferSize is 0, then no output buffer is produced and 0 is returned.
554 If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT().
555 If BufferSize > 0 and FormatString is NULL, then ASSERT().
556 If BufferSize > 0 and FormatString is not aligned on a 16-bit boundary, then ASSERT().
557 If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than
558 PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then
560 If PcdMaximumAsciiStringLength is not zero, and produced Null-terminated ASCII string
561 contains more than PcdMaximumAsciiStringLength ASCII characters not including the
562 Null-terminator, then ASSERT().
564 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
566 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
567 @param FormatString Null-terminated Unicode format string.
568 @param Marker BASE_LIST marker for the variable argument list.
570 @return The number of ASCII characters in the produced output buffer not including the
576 AsciiBSPrintUnicodeFormat (
577 OUT CHAR8
*StartOfBuffer
,
579 IN CONST CHAR16
*FormatString
,
583 ASSERT_UNICODE_BUFFER (FormatString
);
584 return BasePrintLibSPrintMarker (StartOfBuffer
, BufferSize
, FORMAT_UNICODE
, (CHAR8
*)FormatString
, NULL
, Marker
);
588 Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated
589 Unicode format string and variable argument list.
591 Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer
593 The ASCII string is produced by parsing the format string specified by FormatString.
594 Arguments are pulled from the variable argument list based on the contents of the
596 The number of ASCII characters in the produced output buffer is returned not including
598 If BufferSize is 0, then no output buffer is produced and 0 is returned.
600 If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT().
601 If BufferSize > 0 and FormatString is NULL, then ASSERT().
602 If BufferSize > 0 and FormatString is not aligned on a 16-bit boundary, then ASSERT().
603 If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than
604 PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then
606 If PcdMaximumAsciiStringLength is not zero, and produced Null-terminated ASCII string
607 contains more than PcdMaximumAsciiStringLength ASCII characters not including the
608 Null-terminator, then ASSERT().
610 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
612 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
613 @param FormatString Null-terminated Unicode format string.
614 @param ... Variable argument list whose contents are accessed based on the
615 format string specified by FormatString.
617 @return The number of ASCII characters in the produced output buffer not including the
623 AsciiSPrintUnicodeFormat (
624 OUT CHAR8
*StartOfBuffer
,
626 IN CONST CHAR16
*FormatString
,
632 VA_START (Marker
, FormatString
);
633 return AsciiVSPrintUnicodeFormat (StartOfBuffer
, BufferSize
, FormatString
, Marker
);
638 Converts a decimal value to a Null-terminated ASCII string.
640 Converts the decimal number specified by Value to a Null-terminated ASCII string
641 specified by Buffer containing at most Width characters. No padding of spaces
643 If Width is 0 then a width of MAXIMUM_VALUE_CHARACTERS is assumed.
644 The number of ASCII characters in Buffer is returned not including the Null-terminator.
645 If the conversion contains more than Width characters, then only the first Width
646 characters are returned, and the total number of characters required to perform
647 the conversion is returned.
648 Additional conversion parameters are specified in Flags.
649 The Flags bit LEFT_JUSTIFY is always ignored.
650 All conversions are left justified in Buffer.
651 If Width is 0, PREFIX_ZERO is ignored in Flags.
652 If COMMA_TYPE is set in Flags, then PREFIX_ZERO is ignored in Flags, and commas
653 are inserted every 3rd digit starting from the right.
654 If HEX_RADIX is set in Flags, then the output buffer will be
655 formatted in hexadecimal format.
656 If Value is < 0 and HEX_RADIX is not set in Flags, then the fist character in Buffer is a '-'.
657 If PREFIX_ZERO is set in Flags and PREFIX_ZERO is not being ignored,
658 then Buffer is padded with '0' characters so the combination of the optional '-'
659 sign character, '0' characters, digit characters for Value, and the Null-terminator
660 add up to Width characters.
662 If Buffer is NULL, then ASSERT().
663 If unsupported bits are set in Flags, then ASSERT().
664 If both COMMA_TYPE and HEX_RADIX are set in Flags, then ASSERT().
665 If Width >= MAXIMUM_VALUE_CHARACTERS, then ASSERT()
667 @param Buffer Pointer to the output buffer for the produced Null-terminated
669 @param Flags The bitmask of flags that specify left justification, zero pad, and commas.
670 @param Value The 64-bit signed value to convert to a string.
671 @param Width The maximum number of ASCII characters to place in Buffer, not including
674 @return The number of ASCII characters in Buffer not including the Null-terminator.
686 return BasePrintLibConvertValueToString (Buffer
, Flags
, Value
, Width
, 1);