-/*
- * It's bizarre, but with BC++ 4.5, the value of str changes
- * between SetFile and SetStream.
- */
-
-void wxDebugContext::SetStream(ostream *str, streambuf *buf)
-{
-/*
- if (str)
- {
- char buff[128];
- sprintf(buff, "SetStream (1): str is %ld", (long) str);
- MessageBox(NULL, buff, "Memory", MB_OK);
- }
-*/
-
- if (m_debugStream)
- {
- m_debugStream->flush();
- delete m_debugStream;
- }
- m_debugStream = NULL;
-
- // Not allowed in Watcom (~streambuf is protected).
- // Is this trying to say something significant to us??
-#ifndef __WATCOMC__
- if (m_streamBuf)
- {
- streambuf* oldBuf = m_streamBuf;
- m_streamBuf = NULL;
- delete oldBuf;
- }
-#endif
- m_streamBuf = buf;
- m_debugStream = str;
-}
-
-bool wxDebugContext::SetFile(const wxString& file)
-{
- ofstream *str = new ofstream((char *) (const char *)file);
-
- if (str->bad())
- {
- delete str;
- return FALSE;
- }
- else
- {
-/*
- char buf[40];
- sprintf(buf, "SetFile: str is %ld", (long) str);
- MessageBox(NULL, buf, "Memory", MB_OK);
-*/
- SetStream(str);
- return TRUE;
- }
-}
-
-bool wxDebugContext::SetStandardError(void)
-{
-#if !defined(_WINDLL)
- wxDebugStreamBuf *buf = new wxDebugStreamBuf;
- ostream *stream = new ostream(m_streamBuf);
- SetStream(stream, buf);
- return TRUE;
-#else
- return FALSE;
-#endif
-}
-
-