home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c082_122 / 1.ddi / INCLUDE.ZIP / STDIOSTR.H < prev    next >
Encoding:
C/C++ Source or Header  |  1992-06-10  |  1.5 KB  |  73 lines

  1. /* stdiostream.h -- class stdiobuf and stdiostream declarations
  2.  
  3.     Copyright (c) 1990, 1992 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. #if defined(__BCOPT__) && !defined(_RTL_ALLOW_po)
  31. #pragma option -po-
  32. #endif
  33.  
  34. _CLASSDEF(stdiobuf)
  35. _CLASSDEF(stdiostream)
  36.  
  37. class _CLASSTYPE stdiobuf : public streambuf {
  38. public:
  39.     _Cdecl stdiobuf(FILE _FAR *);
  40.     FILE _FAR * _Cdecl stdiofile();
  41.     _Cdecl ~stdiobuf();
  42.  
  43.     virtual int _Cdecl overflow(int=EOF);
  44.     virtual int _Cdecl pbackfail(int);
  45.     virtual int _Cdecl sync();
  46.     virtual streampos _Cdecl seekoff(streamoff, ios::seek_dir, int);
  47.     virtual int _Cdecl underflow();
  48.  
  49. private:
  50.     FILE _FAR * sio;
  51.     char    lahead[2];
  52. };
  53. inline  FILE _FAR * _Cdecl stdiobuf::stdiofile() { return sio; }
  54.  
  55.  
  56. class _CLASSTYPE stdiostream : public ios {
  57. public:
  58.         _Cdecl stdiostream(FILE _FAR *);
  59.         _Cdecl ~stdiostream();
  60.     stdiobuf _FAR * _Cdecl rdbuf();
  61.  
  62. private:
  63.     stdiobuf buf;
  64. };
  65. inline  stdiobuf _FAR * _Cdecl stdiostream::rdbuf() { return &buf; }
  66.  
  67. #pragma option -Vo.
  68. #if defined(__BCOPT__)
  69. #pragma option -po.
  70. #endif
  71.  
  72. #endif
  73.