home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / win3 / patches / symantec / rtlinc.exe / STDIOSTR.H < prev    next >
C/C++ Source or Header  |  1993-06-15  |  794b  |  44 lines

  1. #ifndef __STDIOSTR_H
  2. #define __STDIOSTR_H
  3.  
  4. #include <stdio.h>
  5. #include <iostream.h>
  6.  
  7. #pragma pack(__DEFALIGN)
  8. class stdiobuf : public streambuf {
  9. public:
  10.     stdiobuf(FILE*);
  11.     FILE* stdiofile() { return fp; }
  12.     ~stdiobuf();
  13.  
  14.     int  underflow();
  15. #if __SC__ > 0x214
  16.     int  overflow(int=EOF);
  17. #else
  18.     int overflow(int);
  19. #endif
  20.     int  pbackfail(int);
  21.  
  22. private:
  23.     FILE*   fp;
  24.     char *gptr_;
  25.     char *egptr_;
  26.                 // Save old gptr() & egptr() while using the
  27.                 // pushback buffer.
  28.     char pushback_buf[4];
  29.     int fillbuf();
  30. };
  31.  
  32. class stdiostream : public ios {
  33. public:
  34.     stdiostream(FILE*);
  35.     ~stdiostream();
  36.     stdiobuf* rdbuf() { return &buffer; }
  37.  
  38. private:
  39.     stdiobuf buffer;
  40. };
  41.  
  42. #pragma pack()
  43. #endif
  44.