home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 9 / CDACTUAL9.iso / progs / CB / DATA.Z / STDIOSTR.H < prev    next >
Encoding:
C/C++ Source or Header  |  1996-04-18  |  2.1 KB  |  108 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. /* $Copyright: 1990$ */
  8. /* $Revision:   8.1  $ */
  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.  
  30. #if !defined(RC_INVOKED)
  31.  
  32. #if defined(__BCOPT__)
  33. #if !defined(_RTL_ALLOW_po) && !defined(__FLAT__)
  34. #pragma option -po-     // disable Object data calling convention
  35. #endif
  36. #endif
  37.  
  38. #if !defined(__TINY__)
  39. #pragma option -RT
  40. #endif
  41.  
  42. #pragma option -Vo-
  43.  
  44. #if defined(__STDC__)
  45. #pragma warn -nak
  46. #endif
  47.  
  48. #endif  /* !RC_INVOKED */
  49.  
  50.  
  51. _CLASSDEF(stdiobuf)
  52. _CLASSDEF(stdiostream)
  53.  
  54. class _EXPCLASS stdiobuf : public streambuf {
  55. public:
  56.     _RTLENTRY stdiobuf(FILE _FAR *);
  57.     FILE _FAR * _RTLENTRY stdiofile();
  58.     _RTLENTRY ~stdiobuf();
  59.  
  60.     virtual int _RTLENTRY overflow(int=EOF);
  61.     virtual int _RTLENTRY pbackfail(int);
  62.     virtual int _RTLENTRY sync();
  63.     virtual streampos _RTLENTRY seekoff(streamoff, ios::seek_dir, int);
  64.     virtual int _RTLENTRY underflow();
  65.  
  66. private:
  67.     FILE _FAR * sio;
  68.     char    lahead[2];
  69. };
  70. inline  FILE _FAR * _RTLENTRY stdiobuf::stdiofile() { return sio; }
  71.  
  72.  
  73. class _EXPCLASS stdiostream : public ios {
  74. public:
  75.         _RTLENTRY stdiostream(FILE _FAR *);
  76.         _RTLENTRY ~stdiostream();
  77.     stdiobuf _FAR * _RTLENTRY rdbuf();
  78.  
  79. private:
  80.     stdiobuf buf;
  81. };
  82. inline  stdiobuf _FAR * _RTLENTRY stdiostream::rdbuf() { return &buf; }
  83.  
  84.  
  85. #if !defined(RC_INVOKED)
  86.  
  87. #if defined(__STDC__)
  88. #pragma warn .nak
  89. #endif
  90.  
  91. #pragma option -Vo.
  92.  
  93. #if !defined(__TINY__)
  94. #pragma option -RT.
  95. #endif
  96.  
  97. #if defined(__BCOPT__)
  98. #if !defined(_RTL_ALLOW_po) && !defined(__FLAT__)
  99. #pragma option -po.     // restore Object data calling convention
  100. #endif
  101. #endif
  102.  
  103. #endif  /* !RC_INVOKED */
  104.  
  105.  
  106. #endif   /* __STDSTREAM_H */
  107.  
  108.