home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c063 / 1.ddi / INCLUDE.ZIP / STDIOSTR.H < prev    next >
Encoding:
C/C++ Source or Header  |  1992-02-18  |  1.4 KB  |  67 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. #pragma option -Vo-
  30.  
  31. _CLASSDEF(stdiobuf)
  32. _CLASSDEF(stdiostream)
  33.  
  34. class _CLASSTYPE stdiobuf : public streambuf {
  35. public:
  36.     _Cdecl stdiobuf(FILE *);
  37.     FILE * _Cdecl stdiofile();
  38.     _Cdecl ~stdiobuf();
  39.  
  40.     virtual int _Cdecl overflow(int=EOF);
  41.     virtual int _Cdecl pbackfail(int);
  42.     virtual int _Cdecl sync();
  43.     virtual streampos _Cdecl seekoff(streamoff, ios::seek_dir, int);
  44.     virtual int _Cdecl underflow();
  45.  
  46. private:
  47.     FILE * sio;            
  48.     char    lahead[2];
  49. };
  50. inline  FILE * _Cdecl stdiobuf::stdiofile() { return sio; }
  51.  
  52.  
  53. class _CLASSTYPE stdiostream : public ios {
  54. public:
  55.         _Cdecl stdiostream(FILE *);
  56.         _Cdecl ~stdiostream();
  57.     stdiobuf * _Cdecl rdbuf();
  58.  
  59. private:
  60.     stdiobuf buf;
  61. };
  62. inline  stdiobuf * _Cdecl stdiostream::rdbuf() { return &buf; }
  63.  
  64. #pragma option -Vo.
  65.  
  66. #endif
  67.