|
#include <pantheios/inserters/character.hpp>
This class converts a character variable into a string, thereby enabling it to be inserted into a logging statement. Consider the following statement:
char c = '#'; char s[] = "abc"; std::string str("def"); pantheios::log(pantheios::notice, "s=", s, ", c=", pantheios::character(c), ", str=", str);
This will produce the output:
s=abc, c=#, str=def
cpp/inserters/example.cpp.inserter.character/example.cpp.inserter.character.cpp, and cpp/misc/example.cpp.misc.101/example.cpp.misc.101.cpp.
Public Types | |
typedef character | class_type |
This type. | |
Public Member Functions | |
character (char value) | |
Construct from a char value. | |
pan_char_t const * | data () const |
A possibly non-nul-terminated non-null pointer to the c-style string representation of the character. | |
pan_char_t const * | c_str () const |
A nul-terminated non-null pointer to the c-style string representation of the character. | |
size_t | length () const |
The length of the c-style string representation of the character. |
typedef character class_type |
This type.
character | ( | char | value | ) | [inline, explicit] |
Construct from a char
value.
pan_char_t const * data | ( | ) | const [inline] |
pan_char_t const * c_str | ( | ) | const [inline] |
size_t length | ( | ) | const [inline] |
The length of the c-style string representation of the character.
|
|
pantheios Library documentation © Matthew Wilson & Synesis Software, 2006-2011 |