|   |   | 
|  | |
#include <pantheios/inserters/w2m.hpp>
This class converts a w2m variable into a string, thereby enabling it to be inserted into a logging statement. Consider the following statement:
wchar_t ws = L"abc"; char s[] = "abc"; std::string str("def"); pantheios::log(pantheios::notice, "s=", s, ", c=", pantheios::w2m(ws), ", str=", str);
This will produce the output:
s=abc, c=abc, str=def
cpp/inserters/example.cpp.inserter.w2m/example.cpp.inserter.w2m.cpp, and cpp/misc/example.cpp.misc.custom_type_1/example.cpp.misc.custom_type_1.cpp.
| Public Types | |
| typedef w2m | class_type | 
| This type. | |
| Public Member Functions | |
| w2m (wchar_t const *s) | |
| Construct from a c-style string. | |
| w2m (wchar_t const *s, size_t len) | |
| Construct from a pointer to a string and a given length. | |
| template<typename WS> | |
| w2m (WS const &ws) | |
| Construct from a widestring of unknown type. | |
| ~w2m () throw () | |
| Releases any resources allocated for the conversion. | |
| char const * | data () const | 
| A possibly non-nul-terminated non-null pointer to the c-style string representation of the w2m. | |
| char const * | c_str () const | 
| A nul-terminated non-null pointer to the c-style string representation of the w2m. | |
| size_t | length () const | 
| The length of the c-style string representation of the w2m. | |
| typedef w2m class_type | 
This type.
| w2m | ( | wchar_t const * | s | ) |  [explicit] | 
Construct from a c-style string.
| w2m | ( | WS const & | ws | ) |  [inline, explicit] | 
Construct from a widestring of unknown type.
| ~w2m | ( | ) | throw () | 
Releases any resources allocated for the conversion.
| char const* data | ( | ) | const | 
| char const* c_str | ( | ) | const | 
| size_t length | ( | ) | const | 
The length of the c-style string representation of the w2m.
|  | |
| pantheios Library documentation © Matthew Wilson & Synesis Software, 2006-2011 |  |