home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c021 / 7.img / INCLUDE.ZIP / STDIOSTR.H < prev    next >
Encoding:
C/C++ Source or Header  |  1990-05-04  |  1.1 KB  |  53 lines

  1. /* stdiostream.h -- class stdiobuf and stdiostream declarations
  2.  
  3.     Copyright (c) 1990 by Borland International    
  4.     All rights reserved
  5.  
  6.   NOTE: These are inefficient and obsolete.  Use the standard classes and
  7.     functions in <fstream.h> instead.
  8. */
  9.  
  10. #ifndef __STDSTREAM_H
  11. #define __STDSTREAM_H
  12.  
  13. #include <iostream.h>
  14. #include <stdio.h>
  15.  
  16. #if __STDC__
  17. #define _Cdecl
  18. #else
  19. #define _Cdecl    cdecl
  20. #endif
  21.  
  22. class stdiobuf : public streambuf {
  23. public:
  24.         _Cdecl stdiobuf(FILE*);
  25.     FILE*    _Cdecl stdiofile();
  26.         _Cdecl ~stdiobuf();
  27.  
  28. virtual    int    _Cdecl overflow(int=EOF);
  29. virtual    int    _Cdecl pbackfail(int);
  30. virtual    int    _Cdecl sync();
  31. virtual    streampos _Cdecl seekoff(streamoff, seek_dir, int);
  32. virtual    int    _Cdecl underflow();
  33.  
  34. private:
  35.     FILE*    sio;            
  36.     char    lahead[2];
  37. };
  38. inline    FILE*    _Cdecl stdiobuf::stdiofile() { return sio; }
  39.  
  40.  
  41. class stdiostream : public ios {
  42. public:
  43.         _Cdecl stdiostream(FILE*);
  44.         _Cdecl ~stdiostream();
  45.     stdiobuf* _Cdecl rdbuf();
  46.  
  47. private:
  48.     stdiobuf buf;
  49. };
  50. inline    stdiobuf* _Cdecl stdiostream::rdbuf() { return &buf; }
  51.  
  52. #endif
  53.