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

Public Member Functions | Friends | List of all members
libcwd::char2str Class Reference

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

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) << '\'');
char2str(char ci)
Construct a char2str object with attribute ci.
Definition: char2str.h:63
#define Dout(cntrl, data)
Macro for writing debug output.
Definition: debug.h:154
channel_ct notice
Definition: debug.cc:460
Copyright © 2001 - 2004 Carlo Wood.  All rights reserved.