libcwdversion 2.0.0
The C++ Debugging Support Library
Loading...
Searching...
No Matches

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.

Detailed Description

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) << '\'');
char2str(char ci)
Construct a char2str object with attribute ci.
Definition char2str.h:53
#define Dout(cntrl,...)
Macro for writing debug output.
Definition debug.h:97

The documentation for this class was generated from the following file: