CppCMS
|
Copy the output stream part - "tee" filter. More...
#include <cppcms/copy_filter.h>
Public Member Functions | |
copy_filter (std::ostream &output) | |
~copy_filter () | |
std::string | detach () |
Copy the output stream part - "tee" filter.
This simple class designed to "copy" all the output that comes to the stream to internal buffer and the stream itself and return the copied data on detaching the filter.
It is very useful to use with caching, for example:
cppcms::copy_filter::copy_filter | ( | std::ostream & | output | ) |
Create a filter copying all output to internal buffer
cppcms::copy_filter::~copy_filter | ( | ) |
When destroyed, if the stream wasn't detached aborts coping the data, making it exception safe.
std::string cppcms::copy_filter::detach | ( | ) |
Stop the coping process and return all collected data as string.