Simplified redirection of iostreams. More...
#include <vul_redirector.h>
Public Member Functions | |
| vul_redirector (std::ostream &s) | |
| Attach redirector to std::ostream s, so that all future output to s goes through this->putchunk. More... | |
| virtual | ~vul_redirector () |
| Destroy redirector, restore stream to original. More... | |
| virtual std::streamsize | putchunk (char const *buf, std::streamsize n) |
| The filter function. More... | |
Protected Member Functions | |
| std::streamsize | put_passthru (char const *buf, std::streamsize n) |
| Put characters to original stream. More... | |
| int | sync_passthru () |
| Sync original stream. More... | |
Private Attributes | |
| vul_redirector_data * | p |
Simplified redirection of iostreams.
To implement your own, derive a class from vul_redirector, and implement ‘putchunk’.
Definition at line 26 of file vul_redirector.h.
| vul_redirector::vul_redirector | ( | std::ostream & | s | ) |
Attach redirector to std::ostream s, so that all future output to s goes through this->putchunk.
Definition at line 68 of file vul_redirector.cxx.
|
virtual |
Destroy redirector, restore stream to original.
Definition at line 78 of file vul_redirector.cxx.
|
protected |
Put characters to original stream.
Useful for derived classes which wish to filter a stream.
Definition at line 90 of file vul_redirector.cxx.
|
virtual |
The filter function.
Default action is just to pass text on the old stream.
Called with ‘n’ characters in ‘buf’, do with as you like.
Definition at line 96 of file vul_redirector.cxx.
|
protected |
Sync original stream.
Definition at line 85 of file vul_redirector.cxx.
|
private |
Definition at line 48 of file vul_redirector.h.
1.8.15