[#BloombergLP-bdlb-PrintMethods-print-0a] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlb.adoc[bdlb]::xref:BloombergLP/bdlb/PrintMethods.adoc[PrintMethods]::print :relfileprefix: ../../../ :mrdocs: `print` overloads == Synopses Declared in `<bdlb_printmethods.h>` Format the specified `object` to the specified output `stream`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- std::ostream& xref:BloombergLP/bdlb/PrintMethods/print-08.adoc[print]( std::ostream& stream, char object, int level = 0, int spacesPerLevel = 4); ---- [.small]#xref:BloombergLP/bdlb/PrintMethods/print-08.adoc[_» more..._]# Format the specified `object` to the specified output `stream`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- std::ostream& xref:BloombergLP/bdlb/PrintMethods/print-0f.adoc[print]( std::ostream& stream, unsigned char object, int level = 0, int spacesPerLevel = 4); ---- [.small]#xref:BloombergLP/bdlb/PrintMethods/print-0f.adoc[_» more..._]# Format the specified `object` to the specified output `stream` at the (absolute value of) the optionally specified indentation `level` and return a reference to `stream`. If `level` is specified, optionally specify `spacesPerLevel`, the number of spaces per indentation level for this and all of its nested objects. If `level` is negative, suppress indentation of the first line. If `spacesPerLevel` is negative, format the entire output on one line, suppressing all but the initial indentation (as governed by `level`). If `stream` is not valid on entry, this operation has no effect. As all objects of this type have the same value, `object` is _ignored_ and a descriptive, human‐readable message is output for all objects of this type. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- std::ostream& xref:BloombergLP/bdlb/PrintMethods/print-04e.adoc[print]( std::ostream& stream, std::monostate const& object, int level = 0, int spacesPerLevel = 4); ---- [.small]#xref:BloombergLP/bdlb/PrintMethods/print-04e.adoc[_» more..._]# Format the specified `object` to the specified output `stream` at the (absolute value of) the optionally specified indentation `level` and return a reference to `stream`. If `level` is specified, optionally specify `spacesPerLevel`, the number of spaces per indentation level for this and all of its nested objects. If `level` is negative, suppress indentation of the first line. If `spacesPerLevel` is negative, format the entire output on one line, suppressing all but the initial indentation (as governed by `level`). If `stream` is not valid on entry, this operation has no effect. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class TYPE> std::ostream& xref:BloombergLP/bdlb/PrintMethods/print-049.adoc[print]( std::ostream& stream, TYPE const& object, int level = 0, int spacesPerLevel = 4); ---- [.small]#xref:BloombergLP/bdlb/PrintMethods/print-049.adoc[_» more..._]# Format the specified `object` to the specified output `stream` at the (absolute value of) the optionally specified indentation `level` and return a reference to `stream`. If `level` is specified, optionally specify `spacesPerLevel`, the number of spaces per indentation level for this and all of its nested objects. If `level` is negative, suppress indentation of the first line. If `spacesPerLevel` is negative, format the entire output on one line, suppressing all but the initial indentation (as governed by `level`). If `stream` is not valid on entry, this operation has no effect. A descriptive, human‐readable message, indented according to `level` and `spacesPerLevel`, is output for objects having no value (i.e., `false == object.has_value()`). [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class TYPE> std::ostream& xref:BloombergLP/bdlb/PrintMethods/print-0e.adoc[print]( std::ostream& stream, std::optional<TYPE> const& object, int level = 0, int spacesPerLevel = 4); ---- [.small]#xref:BloombergLP/bdlb/PrintMethods/print-0e.adoc[_» more..._]# Format the specified `object` to the specified output `stream` at the (absolute value of) the optionally specified indentation `level` and return a reference to `stream`. If `level` is specified, optionally specify `spacesPerLevel`, the number of spaces per indentation level for this and all of its nested objects. If `level` is negative, suppress indentation of the first line. If `spacesPerLevel` is negative, format the entire output on one line, suppressing all but the initial indentation (as governed by `level`). If `stream` is not valid on entry, this operation has no effect. A descriptive, human‐readable message, indented according to `level` and `spacesPerLevel`, is output for objects holding the value of type `std::monostate`. Note that a `std::variant` object can hold the `std::monostate` value only if its template parameters explicitly mention the `std::monostate` type. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class... TYPE> std::ostream& xref:BloombergLP/bdlb/PrintMethods/print-062.adoc[print]( std::ostream& stream, std::variant<TYPE...> const& object, int level = 0, int spacesPerLevel = 4); ---- [.small]#xref:BloombergLP/bdlb/PrintMethods/print-062.adoc[_» more..._]# Format the specified `object` to the specified output `stream` at the (absolute value of) the optionally specified indentation `level` and return a reference to stream. Note that output will be formatted on one line. Also note that non‐printable characters in `object` will be printed using their hexadecimal representation. If `stream` is not valid on entry, this operation has no effect. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class ALLOC> std::ostream& xref:BloombergLP/bdlb/PrintMethods/print-02.adoc[print]( std::ostream& stream, xref:bsl/vector-00d.adoc[bsl::vector<char, ALLOC>] const& object, int level = 0, int spacesPerLevel = 4); ---- [.small]#xref:BloombergLP/bdlb/PrintMethods/print-02.adoc[_» more..._]# Format the specified `object` to the specified output `stream` at the (absolute value of) the optionally specified indentation `level` and return a reference to stream. Note that output will be formatted on one line. If `stream` is not valid on entry, this operation has no effect. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class CHAR_T, class CHAR_TRAITS_T, class ALLOC> std::ostream& xref:BloombergLP/bdlb/PrintMethods/print-06a.adoc[print]( std::ostream& stream, xref:bsl/basic_string-0faf.adoc[bsl::basic_string<CHAR_T, CHAR_TRAITS_T, ALLOC>] const& object, int level = 0, int spacesPerLevel = 4); ---- [.small]#xref:BloombergLP/bdlb/PrintMethods/print-06a.adoc[_» more..._]# [.small]#Created with https://www.mrdocs.com[MrDocs]#