home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1998 May / Pcwk5b98.iso / Borland / Cplus45 / BC45 / INC.PAK / STDIOSTR.H < prev    next >
C/C++ Source or Header  |  1995-08-29  |  2KB  |  113 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.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. #if !defined(_RTL_ALLOW_po) && !defined(__FLAT__)
  39. #pragma option -po-     // disable Object data calling convention
  40. #endif
  41. #endif
  42.  
  43. #if !defined(__TINY__)
  44. #pragma option -RT
  45. #endif
  46.  
  47. #pragma option -Vo-
  48.  
  49. #if defined(__STDC__)
  50. #pragma warn -nak
  51. #endif
  52.  
  53. #endif  /* !RC_INVOKED */
  54.  
  55.  
  56. _CLASSDEF(stdiobuf)
  57. _CLASSDEF(stdiostream)
  58.  
  59. class _EXPCLASS stdiobuf : public streambuf {
  60. public:
  61.     _RTLENTRY stdiobuf(FILE _FAR *);
  62.     FILE _FAR * _RTLENTRY stdiofile();
  63.     _RTLENTRY ~stdiobuf();
  64.  
  65.     virtual int _RTLENTRY overflow(int=EOF);
  66.     virtual int _RTLENTRY pbackfail(int);
  67.     virtual int _RTLENTRY sync();
  68.     virtual streampos _RTLENTRY seekoff(streamoff, ios::seek_dir, int);
  69.     virtual int _RTLENTRY underflow();
  70.  
  71. private:
  72.     FILE _FAR * sio;
  73.     char    lahead[2];
  74. };
  75. inline  FILE _FAR * _RTLENTRY stdiobuf::stdiofile() { return sio; }
  76.  
  77.  
  78. class _EXPCLASS stdiostream : public ios {
  79. public:
  80.         _RTLENTRY stdiostream(FILE _FAR *);
  81.         _RTLENTRY ~stdiostream();
  82.     stdiobuf _FAR * _RTLENTRY rdbuf();
  83.  
  84. private:
  85.     stdiobuf buf;
  86. };
  87. inline  stdiobuf _FAR * _RTLENTRY stdiostream::rdbuf() { return &buf; }
  88.  
  89.  
  90. #if !defined(RC_INVOKED)
  91.  
  92. #if defined(__STDC__)
  93. #pragma warn .nak
  94. #endif
  95.  
  96. #pragma option -Vo.
  97.  
  98. #if !defined(__TINY__)
  99. #pragma option -RT.
  100. #endif
  101.  
  102. #if defined(__BCOPT__)
  103. #if !defined(_RTL_ALLOW_po) && !defined(__FLAT__)
  104. #pragma option -po.     // restore Object data calling convention
  105. #endif
  106. #endif
  107.  
  108. #endif  /* !RC_INVOKED */
  109.  
  110.  
  111. #endif   /* __STDSTREAM_H */
  112.  
  113.