home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / borhead.zip / STDIOSTR.H < prev    next >
C/C++ Source or Header  |  1994-11-09  |  2KB  |  107 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 1.5
  9.  *
  10.  *      Copyright (c) 1990, 1994 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. #if !defined(RC_INVOKED)
  36.  
  37. #if defined(__BCOPT__)
  38. #endif
  39.  
  40. #if !defined(__TINY__)
  41. #pragma option -RT
  42. #endif
  43.  
  44. #pragma option -Vo-
  45.  
  46. #if defined(__STDC__)
  47. #pragma warn -nak
  48. #endif
  49.  
  50. #endif  /* !RC_INVOKED */
  51.  
  52.  
  53. _CLASSDEF(stdiobuf)
  54. _CLASSDEF(stdiostream)
  55.  
  56. class _EXPCLASS stdiobuf : public streambuf {
  57. public:
  58.     _RTLENTRY stdiobuf(FILE _FAR *);
  59.     FILE _FAR * _RTLENTRY stdiofile();
  60.     _RTLENTRY ~stdiobuf();
  61.  
  62.     virtual int _RTLENTRY overflow(int=EOF);
  63.     virtual int _RTLENTRY pbackfail(int);
  64.     virtual int _RTLENTRY sync();
  65.     virtual streampos _RTLENTRY seekoff(streamoff, ios::seek_dir, int);
  66.     virtual int _RTLENTRY underflow();
  67.  
  68. private:
  69.     FILE _FAR * sio;
  70.     char    lahead[2];
  71. };
  72. inline  FILE _FAR * _RTLENTRY stdiobuf::stdiofile() { return sio; }
  73.  
  74.  
  75. class _EXPCLASS stdiostream : public ios {
  76. public:
  77.         _RTLENTRY stdiostream(FILE _FAR *);
  78.         _RTLENTRY ~stdiostream();
  79.     stdiobuf _FAR * _RTLENTRY rdbuf();
  80.  
  81. private:
  82.     stdiobuf buf;
  83. };
  84. inline  stdiobuf _FAR * _RTLENTRY stdiostream::rdbuf() { return &buf; }
  85.  
  86.  
  87. #if !defined(RC_INVOKED)
  88.  
  89. #if defined(__STDC__)
  90. #pragma warn .nak
  91. #endif
  92.  
  93. #pragma option -Vo.
  94.  
  95. #if !defined(__TINY__)
  96. #pragma option -RT.
  97. #endif
  98.  
  99. #if defined(__BCOPT__)
  100. #endif
  101.  
  102. #endif  /* !RC_INVOKED */
  103.  
  104.  
  105. #endif   /* __STDSTREAM_H */
  106.  
  107.