|
#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
cpp/inserters/example.cpp.inserter.p/example.cpp.inserter.p.cpp, and cpp/inserters/example.cpp.inserter.pointer/example.cpp.inserter.pointer.cpp.
Public Types | |
typedef pointer | class_type |
This type. | |
Public Member Functions | |
pointer (void const volatile *pv, int widthAndFormat) | |
[DEPRECATED] Construct from a pointer, with width/format specifier | |
pointer (void const volatile *pv, int minWidth, int format) | |
Construct from a pointer, specifying width and format. | |
pan_char_t const * | data () const |
A possibly non-nul-terminated non-null pointer to the c-style string representation of the pointer. | |
pan_char_t 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. |
typedef pointer class_type |
pointer | ( | void const volatile * | pv, | |
int | widthAndFormat | |||
) |
[DEPRECATED] Construct from a pointer, with width/format specifier
pv | The pointer whose value will be inserted | |
widthAndFormat | A bitwise combination of width and format. The width must be in the range [0, 20] |
pointer | ( | void const volatile * | pv, | |
int | minWidth, | |||
int | format | |||
) |
pan_char_t const* data | ( | ) | const |
pan_char_t const* c_str | ( | ) | const |
size_t length | ( | ) | const |
The length of the c-style string representation of the pointer.
|
|
pantheios Library documentation © Matthew Wilson & Synesis Software, 2006-2011 |