home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c083 / 14.ddi / GENINC.PAK / STDIOSTR.H < prev    next >
Encoding:
C/C++ Source or Header  |  1993-12-02  |  1.8 KB  |  84 lines

  1. /* stdiostream.h -- class stdiobuf and stdiostream declarations
  2.  
  3.     NOTE: These are inefficient and obsolete.  Use the standard classes and
  4.     functions in <fstream.h> instead.
  5. */
  6.  
  7. /*
  8.  *      C/C++ Run Time Library - Version 6.0
  9.  *
  10.  *      Copyright (c) 1990, 1993 by Borland International
  11.  *      All Rights Reserved.
  12.  *
  13.  */
  14.  
  15. #ifndef __cplusplus
  16. #error Must use C++ for the type stdiostream.
  17. #endif
  18.  
  19. #ifndef __STDSTREAM_H
  20. #define __STDSTREAM_H
  21.  
  22. #if !defined( ___DEFS_H )
  23. #include <_defs.h>
  24. #endif
  25.  
  26. #if !defined( __IOSTREAM_H )
  27. #include <iostream.h>
  28. #endif
  29.  
  30. #if !defined( __STDIO_H )
  31. #include <stdio.h>
  32. #endif
  33.  
  34.  
  35. #pragma option -Vo-
  36. #if defined(__BCOPT__) && !defined(_RTL_ALLOW_po) && !defined(__FLAT__)
  37. #pragma option -po-
  38. #endif
  39.  
  40. #pragma option -RT
  41.  
  42. _CLASSDEF(stdiobuf)
  43. _CLASSDEF(stdiostream)
  44.  
  45. class _EXPCLASS stdiobuf : public streambuf {
  46. public:
  47.     _RTLENTRY stdiobuf(FILE _FAR *);
  48.     FILE _FAR * _RTLENTRY stdiofile();
  49.     _RTLENTRY ~stdiobuf();
  50.  
  51.     virtual int _RTLENTRY overflow(int=EOF);
  52.     virtual int _RTLENTRY pbackfail(int);
  53.     virtual int _RTLENTRY sync();
  54.     virtual streampos _RTLENTRY seekoff(streamoff, ios::seek_dir, int);
  55.     virtual int _RTLENTRY underflow();
  56.  
  57. private:
  58.     FILE _FAR * sio;            
  59.     char    lahead[2];
  60. };
  61. inline  FILE _FAR * _RTLENTRY stdiobuf::stdiofile() { return sio; }
  62.  
  63.  
  64. class _EXPCLASS stdiostream : public ios {
  65. public:
  66.         _RTLENTRY stdiostream(FILE _FAR *);
  67.         _RTLENTRY ~stdiostream();
  68.     stdiobuf _FAR * _RTLENTRY rdbuf();
  69.  
  70. private:
  71.     stdiobuf buf;
  72. };
  73. inline  stdiobuf _FAR * _RTLENTRY stdiostream::rdbuf() { return &buf; }
  74.  
  75. #pragma option -RT.
  76.  
  77. #pragma option -Vo.
  78. #if defined(__BCOPT__) && !defined(_RTL_ALLOW_po) && !defined(__FLAT__) 
  79. #pragma option -po.
  80. #endif
  81.  
  82. #endif   /* __STDSTREAM_H */
  83.  
  84.