home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0040 - 0049 / ibm0040-0049 / ibm0040.tar / ibm0040 / BCPPOWL3.ZIP / PATINC.ZIP / STDIOSTR.H < prev    next >
Encoding:
C/C++ Source or Header  |  1991-08-28  |  1.4 KB  |  63 lines

  1. /* stdiostream.h -- class stdiobuf and stdiostream declarations
  2.  
  3.     Copyright (c) 1990,1991 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 __cplusplus
  11. #error Must use C++ for the type stdiostream.
  12. #endif
  13.  
  14. #ifndef __STDSTREAM_H
  15. #define __STDSTREAM_H
  16.  
  17. #if !defined( __DEFS_H )
  18. #include <_defs.h>
  19. #endif
  20.  
  21. #if !defined( __IOSTREAM_H )
  22. #include <iostream.h>
  23. #endif
  24.  
  25. #if !defined( __STDIO_H )
  26. #include <stdio.h>
  27. #endif
  28.  
  29. _CLASSDEF(stdiobuf)
  30. _CLASSDEF(stdiostream)
  31.  
  32. class _CLASSTYPE stdiobuf : public streambuf {
  33. public:
  34.     _Cdecl stdiobuf(FILE _FAR *);
  35.     FILE _FAR * _Cdecl stdiofile();
  36.     _Cdecl ~stdiobuf();
  37.  
  38.     virtual int _Cdecl overflow(int=EOF);
  39.     virtual int _Cdecl pbackfail(int);
  40.     virtual int _Cdecl sync();
  41.     virtual streampos _Cdecl seekoff(streamoff, seek_dir, int);
  42.     virtual int _Cdecl underflow();
  43.  
  44. private:
  45.     FILE _FAR * sio;            
  46.     char    lahead[2];
  47. };
  48. inline  FILE _FAR * _Cdecl stdiobuf::stdiofile() { return sio; }
  49.  
  50.  
  51. class _CLASSTYPE stdiostream : public ios {
  52. public:
  53.         _Cdecl stdiostream(FILE _FAR *);
  54.         _Cdecl ~stdiostream();
  55.     stdiobuf _FAR * _Cdecl rdbuf();
  56.  
  57. private:
  58.     stdiobuf buf;
  59. };
  60. inline  stdiobuf _FAR * _Cdecl stdiostream::rdbuf() { return &buf; }
  61.  
  62. #endif
  63.