#include <pantheios/inserters/pointer.hpp>
This class converts a pointer variable into a string, thereby enabling it to be inserted into a logging statement. Consider the following statement
void *p = reinterpret_cast<void*>(0x01234567); char s[] = "abc"; std::string str("def"); pantheios::log(pantheios::notice, "s=", s, ", p=", pantheios::pointer(p, 8 | pantheios::fmt::fullHex), ", str=", str);
This will produce the output:
s=abc, p=0x01234567, str=def
Public Types | |
typedef pointer | class_type |
Public Member Functions | |
pointer (void const *pv, int widthAndFormat) | |
Construct from a pointer, with width/format specifier. | |
char const * | data () const |
A possibly non-nul-terminated non-null pointer to the c-style string representation of the pointer. | |
char const * | c_str () const |
A nul-terminated non-null pointer to the c-style string representation of the pointer. | |
size_t | length () const |
The length of the c-style string representation of the pointer. |
|
|
|
Construct from a pointer, with width/format specifier.
|
|
A nul-terminated non-null pointer to the c-style string representation of the pointer.
|
|
A possibly non-nul-terminated non-null pointer to the c-style string representation of the pointer.
|
|
The length of the c-style string representation of the pointer.
|
|
|
pantheios Library documentation © Matthew Wilson, 2006 |
|