#include <StreamBuf.h>
Public Member Functions | |
| StreamBuf () | |
| ~StreamBuf () | |
| bool | Open (const std::string &fname) |
| bool | Close () |
Private Member Functions | |
| StreamBuf (const StreamBuf &) | |
| StreamBuf & | operator= (const StreamBuf &) |
Private Attributes | |
| std::ofstream | fRedirect |
| std::streambuf * | fBufCerr |
| std::streambuf * | fBufCout |
|
|
Definition at line 43 of file StreamBuf.h.
|
|
|
Definition at line 46 of file StreamBuf.h. 00047 {
00048 StreamBuf::Close();
00049 }
|
|
|
|
|
|
Definition at line 74 of file StreamBuf.h. References fBufCerr, fBufCout, and fRedirect. 00075 {
00076 if(fRedirect.is_open())
00077 {
00078 std::cout.rdbuf(fBufCout);
00079 std::cerr.rdbuf(fBufCerr);
00080 fRedirect.close();
00081 return true;
00082 }
00083
00084 return false;
00085 }
|
|
|
Definition at line 51 of file StreamBuf.h. References fBufCerr, fBufCout, and fRedirect. Referenced by Anp::RunModule::Config(). 00052 {
00053 fRedirect.open(fname.c_str());
00054 if(fRedirect.is_open())
00055 {
00056 std::cout << "StreamBuf - sending cout and cerr streams to file:" << std::endl
00057 << " " << fname << std::endl;
00058
00059 fBufCout = std::cout.rdbuf();
00060 fBufCerr = std::cerr.rdbuf();
00061
00062 std::cout.rdbuf(fRedirect.rdbuf());
00063 std::cerr.rdbuf(fRedirect.rdbuf());
00064
00065 return true;
00066 }
00067
00068 fRedirect.close();
00069 std::cerr << "StreamBuf::Config - failed to open file:" << std::endl
00070 << " " << fname << std::endl;
00071 return false;
00072 }
|
|
|
|
|
|
Definition at line 36 of file StreamBuf.h. |
|
|
Definition at line 37 of file StreamBuf.h. |
|
|
Definition at line 35 of file StreamBuf.h. |
1.3.9.1