home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_11_09 / 1109060b < prev    next >
Text File  |  1993-07-08  |  613b  |  31 lines

  1. //  winstrm.cpp
  2.  
  3. #include    "stdhdr.h"
  4. #include    "winstrm.h"
  5.  
  6. winstreambuf::winstreambuf ()
  7.     : streambuf (buffer, winstreambuf_buf_size)
  8. {
  9. *buffer = 0;
  10. reset_buffer ();
  11. stream_window = NULL;
  12. }
  13.  
  14. int winstreambuf::sync ()
  15. {
  16. ASSERT (stream_window != NULL);
  17. stream_window->PutText (pbase (), out_waiting ());
  18. reset_buffer ();
  19. return 0;
  20. }
  21.  
  22. int winstreambuf::overflow (int nCh = EOF)
  23. {
  24. stream_window->PutText (pbase (), out_waiting ());
  25. if (nCh != EOF)
  26.     //  Ie nCh caused the overflow and must be output
  27.     stream_window->PutText ((char *) &nCh, 1);
  28. reset_buffer ();
  29. return 0;
  30. }
  31.