Classes | |
struct | out_base |
In case your gather class returns anything else than a std::basic_ostream, that returned class must derive from this. More... | |
Namespaces | |
namespace | ostream_like |
Gathering the message: Allows you to write to a log using the cool "<<" operator. |
A class that implements gathering the message needs 2 things:
.out()
.msg()
that will return the gathered data (once all data has been gathered).Implementing a gather class is rather easy, here's a simple example:
struct return_str { typedef std::basic_ostringstream<char_type> stream_type; stream_type & out() { return m_out; } std::basic_string<char_type> msg() { return m_out.str(); } private: stream_type m_out; };