]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Library/PrintLib.h
Add full description of the Format string to the file header of the Print Library
[mirror_edk2.git] / MdePkg / Include / Library / PrintLib.h
CommitLineData
488ee641 1/** @file\r
50a64e5b 2 Provides services to print a formatted string to a buffer. All combinations of\r
3 Unicode and ASCII strings are supported.\r
488ee641 4\r
50a64e5b 5Copyright (c) 2006 - 2008, Intel Corporation\r
6All rights reserved. This program and the accompanying materials\r
7are licensed and made available under the terms and conditions of the BSD License\r
8which accompanies this distribution. The full text of the license may be found at\r
9http://opensource.org/licenses/bsd-license.php\r
488ee641 10\r
50a64e5b 11THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
12WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
488ee641 13\r
b7ca8783 14 The Print Library functions provide a simple means to produce formatted output \r
15 strings. Many of the output functions use a format string to describe how to \r
16 format the output of variable arguments. The format string consists of normal \r
17 text and argument descriptors. There are no restrictions for how the normal \r
18 text and argument descriptors can be mixed. A normal text character '\n' must \r
19 always be converted to '\n\r'. This does not follow the ANSI C standard for \r
20 sprint(). The format of argument descriptors is described below. The ANSI C \r
21 standard for sprint() has been followed for some of the format types, and has \r
22 not been followed for others. The exceptions are noted below.\r
23\r
24 %[flags][width][.precision]type\r
25\r
26 [flags]:\r
27 - - \r
28 - The field is left justified. If not flag is not specified, then the \r
29 field is right justified.\r
30 - space \r
31 - Prefix a space character to a number. Only valid for types X, x, and d.\r
32 - + \r
33 - Prefix a plus character to a number. Only valid for types X, x, and d. \r
34 If both space and + are specified, then space is ignored.\r
35 - 0\r
36 - Pad with 0 characters to the left of a number. Only valid for types \r
37 X, x, and d.\r
38 - ,\r
39 - Place a comma every 3rd digit of the number. Only valid for type d.\r
40 If 0 is also specified, then 0 is ignored.\r
41 - L, l\r
42 - The number being printed is a UINT64. Only valid for types X, x, and d.\r
43 If this flag is not specified, then the number being printed is a int.\r
44 - NOTE: All invalid flags are ignored.\r
45\r
46 [width]:\r
47\r
48 - *\r
49 - The width of the field is specified by a UINTN argument in the \r
50 argument list.\r
51 - number\r
52 - The number specified as a decimal value represents the width of \r
53 the field.\r
54 - NOTE: If [width] is not specified, then a field width of 0 is assumed.\r
55\r
56 [.precision]:\r
57\r
58 - *\r
59 - The prevision of the field is specified by a UINTN argument in the \r
60 argument list.\r
61 - number\r
62 - The number specified as a decimal value represents the precision of \r
63 the field.\r
64 - NOTE: If [.precision] is not specified, then a precision of 0 is assumed.\r
65\r
66 type:\r
67\r
68 - %\r
69 - Print a %%.\r
70 - c\r
71 - The argument is a Unicode character. ASCII characters can be printed \r
72 using this type too by making sure bits 8..15 of the argument are set to 0.\r
73 - x\r
74 - The argument is a hexadecimal number. The characters used are 0..9 and \r
75