home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1997 May / Pcwk0597.iso / sybase / starbuck / h.z / STDIOBUF.H < prev    next >
C/C++ Source or Header  |  1996-07-24  |  1KB  |  53 lines

  1. //
  2. //  stdiobuf.h    Standard I/O streams
  3. //
  4. //  Copyright by WATCOM International Corp. 1988-1996.  All rights reserved.
  5. //
  6. #ifndef _STDIOBUF_H_INCLUDED
  7. #define _STDIOBUF_H_INCLUDED
  8.  
  9. #ifndef __cplusplus
  10. #error stdiobuf.h is for use with C++
  11. #endif
  12.  
  13. #ifndef _COMDEF_H_INCLUDED
  14.  #include <_comdef.h>
  15. #endif
  16. #ifndef _STDIO_H_INCLUDED
  17.  #include <stdio.h>
  18. #endif
  19. #ifndef _IOSTREAM_H_INCLUDED
  20.  #include <iostream.h>
  21. #endif
  22.  
  23. // **************************** STDIOBUF *************************************
  24. #if defined(_M_IX86)
  25.   #pragma pack(__push,1);
  26. #else
  27.   #pragma pack(__push,8);
  28. #endif
  29. class _WPRTLINK stdiobuf : public streambuf {
  30. public:
  31.     stdiobuf();
  32.     stdiobuf( FILE *__fptr );
  33.     ~stdiobuf();
  34.  
  35.     FILE *stdiofile();
  36.     
  37.     virtual int overflow( int = EOF );
  38.     virtual int underflow();
  39.     virtual int    sync();
  40.  
  41. private:
  42.     FILE *__file_pointer;
  43.     char __unbuffered_get_area[ DEFAULT_PUTBACK_SIZE+1 ];
  44.     int : 0;
  45. };
  46. #pragma pack(__pop);
  47.  
  48. inline FILE *stdiobuf::stdiofile() {
  49.     return __file_pointer;
  50. }
  51.  
  52. #endif
  53.