#include <gul_std.h>
Public Methods | |
GULAPI | debug_streambuf (FILE *logfile) |
GULAPI | ~debug_streambuf () |
Static Public Methods | |
void | atexit_func (void) |
Public Attributes | |
int | m_bptr |
char | m_buf [1024] |
FILE * | m_logfile |
streambufrec * | m_oldsb |
Static Public Attributes | |
bool | initialized = false |
Protected Methods | |
int | overflow (int c) |
|
Definition at line 44 of file gul_std.cpp. References GULAPI, initialized, m_bptr, m_logfile, and m_oldsb.
00045 { 00046 m_bptr = 0; 00047 m_logfile = logfile; 00048 00049 m_oldsb = new streambufrec; 00050 OldStreambufs.Append(m_oldsb); 00051 00052 m_oldsb->cerr_buf = std::cerr.rdbuf(); 00053 m_oldsb->cout_buf = std::cout.rdbuf(); 00054 std::cerr.rdbuf( this ); 00055 std::cout.rdbuf( this ); 00056 if( !initialized ) 00057 { 00058 atexit(debug_streambuf::atexit_func); 00059 initialized = true; 00060 } 00061 } |
|
Definition at line 99 of file gul_std.cpp. References GULAPI, and m_oldsb.
|
|
Definition at line 82 of file gul_std.cpp.
00083 { 00084 streambufrec *oldsb,*oldsb_next; 00085 00086 oldsb = OldStreambufs.First(); 00087 OldStreambufs.ReleaseElems(); 00088 00089 while( oldsb ) 00090 { 00091 std::cerr.rdbuf( oldsb->cerr_buf ); 00092 std::cout.rdbuf( oldsb->cout_buf ); 00093 oldsb_next = oldsb->next; 00094 delete oldsb; 00095 oldsb = oldsb_next; 00096 } 00097 } |
|
Definition at line 63 of file gul_std.cpp. References m_bptr, m_buf, and m_logfile.
00064 { 00065 m_buf[m_bptr++] = c; 00066 00067 if( (c == '\n') || (m_bptr == 1023) ) 00068 { 00069 m_buf[m_bptr] = 0; 00070 00071 if( m_logfile ) 00072 fprintf(m_logfile,m_buf); 00073 printf(m_buf); 00074 #ifdef _MSC_VER 00075 OutputDebugStringA(m_buf); 00076 #endif 00077 m_bptr = 0; 00078 } 00079 return(c); 00080 } |
|
Definition at line 110 of file gul_std.cpp. Referenced by debug_streambuf(). |
|
Definition at line 94 of file gul_std.h. Referenced by debug_streambuf(), and overflow(). |
|
Definition at line 95 of file gul_std.h. Referenced by overflow(). |
|
Definition at line 96 of file gul_std.h. Referenced by debug_streambuf(), and overflow(). |
|
Definition at line 97 of file gul_std.h. Referenced by debug_streambuf(), and ~debug_streambuf(). |