Print a char to a debug ostream, escaping non-printable characters as needed.
More...
#include <libcwd/char2str.h>
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. | |
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 \\.
Example:
char c = '\f'; Dout(dc::notice, "The variable c contains: '" << char2str(c) << '\'');