[#BloombergLP-bslim-Printer]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslim.adoc[bslim]::Printer
:relfileprefix: ../../
:mrdocs:

This class implements a _mechanism_ used to format data as required by the standard BDE `print` method contract&period;

== Synopsis

Declared in `&lt;bslim&lowbar;printer&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class Printer;
----

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bslim/Printer/2constructor.adoc[`Printer`]         [.small]#[constructor]#
| Create a `Printer` object that will print to the specified `stream` in a format dictated by the values of the specified `level` and `spacesPerLevel`, as per the contract of the standard BDE `print` method&period; The behavior is undefined unless `stream` is valid&period;
| xref:BloombergLP/bslim/Printer/2destructor.adoc[`&#126;Printer`] [.small]#[destructor]#
| Destroy this `Printer` object&period;
| xref:BloombergLP/bslim/Printer/absLevel.adoc[`absLevel`] 
| Return the absolute value of the formatting level supplied at construction&period;
| xref:BloombergLP/bslim/Printer/end.adoc[`end`] 
| If `spacesPerLevel() &gt;&equals; 0`, print a newline character to the output stream supplied at construction&period; If the optionally specified `suppressBracket` is false, print a closing square bracket, indented by `absLevel() &ast; spacesPerLevel()` blank spaces&period;
| xref:BloombergLP/bslim/Printer/print.adoc[`print`] 
| Format to the output stream supplied at construction the specified `data`, prefixed by the specified `name` if `name` is not 0&period; Format `data` based on the parameterized `TYPE`&colon;
| xref:BloombergLP/bslim/Printer/printAttribute-0e.adoc[`printAttribute`] 
| `printAttribute` overloads
| xref:BloombergLP/bslim/Printer/printEndIndentation.adoc[`printEndIndentation`] 
| Print to the output stream supplied at construction `absLevel() &ast; spacesPerLevel()` blank spaces if `spacesPerLevel() &gt;&equals; 0`, and print a single blank space otherwise&period;
| xref:BloombergLP/bslim/Printer/printForeign.adoc[`printForeign`] 
| Print to the output stream supplied at construction the specified `name`, if name is not 0, and then call the specified `printFunctionObject` with the specified `data`, the `stream` supplied at construction, `absLevel() &plus; 1`, and `spacesPerLevel()`&period; The parameterized `PRINT&lowbar;FUNCTOR` must be an invocable type whose arguments match the following function signature&colon; &grave; bsl&colon;&colon;ostream&amp; (&ast;)(bsl&colon;&colon;ostream&amp; stream, const TYPE&amp; data, int level, int spacesPerLevel) &grave;
| xref:BloombergLP/bslim/Printer/printHexAddr.adoc[`printHexAddr`] 
| Write to the output stream supplied at construction the specified `address` in a hexadecimal format, if `address` is not 0, and print the string &quot;NULL&quot; otherwise, prefixed by the specified `name` if `name` is not 0&period; If `spacesPerLevel() &lt; 0`, print on a single line&period; If `spacesPerLevel() &gt;&equals; 0`, indent by `(absLevel() &plus; 1) &ast; spacesPerLevel()` blank spaces&period;
| xref:BloombergLP/bslim/Printer/printIndentation.adoc[`printIndentation`] 
| Print to the output stream supplied at construction `(absLevel() &plus; 1) &ast; spacesPerLevel()` blank spaces if `spacesPerLevel() &gt;&equals; 0`, and print a single blank space otherwise&period;
| xref:BloombergLP/bslim/Printer/printOrNull-0bc.adoc[`printOrNull`] 
| Format to the output stream supplied at construction the object at the specified `address`, if `address` is not 0, and print the string &quot;NULL&quot; otherwise, prefixed by the specified `name` if `name` is not 0&period; If `spacesPerLevel() &lt; 0`, print on a single line&period; If `spacesPerLevel() &gt;&equals; 0`, indent by `(absLevel() &plus; 1) &ast; spacesPerLevel()` blank spaces&period; The behavior is undefined unless `TYPE` is a pointer type&period;
| xref:BloombergLP/bslim/Printer/printValue-0e.adoc[`printValue`] 
| `printValue` overloads
| xref:BloombergLP/bslim/Printer/spacesPerLevel.adoc[`spacesPerLevel`] 
| Return the number of whitespace characters to output for each level of indentation&period; The number of whitespace characters for each level of indentation is configured using the `spacesPerLevel` supplied at construction&period;
| xref:BloombergLP/bslim/Printer/start.adoc[`start`] 
| Print to the output stream supplied at construction `absLevel() &ast; spacesPerLevel()` blank spaces if the `suppressInitialIndentFlag` is `false`, and suppress the initial indentation otherwise&period; If the optionally specified `suppressBracket` is `false`, print an opening square bracket&period;
| xref:BloombergLP/bslim/Printer/suppressInitialIndentFlag.adoc[`suppressInitialIndentFlag`] 
| Return `true` if the initial output indentation will be suppressed, and `false` otherwise&period; The initial indentation will be suppressed if the `level` supplied at construction is negative&period;
|===



[.small]#Created with https://www.mrdocs.com[MrDocs]#
