libcwd: The C++ Debugging Support Library - Reference Manual
Author: Carlo Wood
Description: C++ debugging support library with ostream debug output
Keywords: libcwd, debug output, debug facility, debug channel, object orientation, OO, C++, nested debug output, ostream, memory allocation, debugging, source file and line number

Main Page Reference Manual Namespace List Compound List Namespace Members Compound Members File Members

# libcwd::char2str Class Reference
[Special Functions And Utilities]

Print a `char` to a debug ostream, escaping non-printable characters as needed. More...

`#include <libcwd/char2str.h>`

List of all members.

## Public Member Functions
| char2str (char ci)
| Construct a `char2str` object with attribute ci.
## Friends
std::ostream & | operator<< (std::ostream &os, char2str const c2s)
| Write the character represented by c2s to the `ostream` os, escaping it when it is a non-printable character.

## Detailed Description

Print a `char` to a debug ostream, escaping non-printable characters as needed.

Prints the character c (see example below) to an ostream, converting it into a printable sequence when needed using the octal representation or one of `\a`, `\b`, `\t`, `\n`, `\f`, `\r`, `\e` or `\\`.

See also:
  libcwd::buf2str

Example:

     char c = '\f';

     Dout(dc::notice, "The variable c contains: '" << char2str(c) << '\'');