Format to the output stream supplied at construction the specified data, prefixed by the specified name if name is not 0. Format data based on the parameterized TYPE:

Synopsis

Declared in <bslim_printer.h>

template<class TYPE>
void
print(
    TYPE const& data,
    char const* name) const;

Description

* If TYPE is a fundamental type, output data to the stream. * If TYPE is char * or const char *, print data to the stream as a null‐terminated C‐style string enclosed in quotes if data is not 0, and print the string "NULL" otherwise. * If TYPE is void * or const void *, print the address value of data in hexadecimal format if it is not 0, and print the string "NULL" otherwise. * If TYPE is a pointer type (other than the, potentially const‐qualified, char * or void *), print the address value of data in hexadecimal format, then format the object at that address if data is not 0, and print the string "NULL" otherwise. There will be a compile‐time error if data is a pointer to a user‐defined type that does not provide a standard print method. * If TYPE is any other type, call the standard print method on data, specifying one additional level of indentation than the current one. There will be a compile‐time error if TYPE does not provide a standard print method.

If spacesPerLevel() < 0, format data on a single line. Otherwise, indent data by (absLevel() + 1) * spacesPerLevel() blank spaces. The behavior is undefined if TYPE is a char *, but not a null‐terminated string.

DEPRECATED: Use printAttribute instead, or printValue if no name is wanted.

Created with MrDocs