home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / Compilers / digital marsC compier / dm / include / Stdiostr.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-01-02  |  2.4 KB  |  112 lines

  1. #if __SC__ || __RCC__
  2. #pragma once
  3. #endif
  4.  
  5. #ifndef _STDSTREAM_H_
  6. #define _STDSTREAM_H_
  7.  
  8. #ifndef __cplusplus
  9. #error  Use C++ compiler for stdiostr.h
  10. #endif
  11.  
  12. /*
  13.  *    stdiostream.h -- class stdiobuf and stdiostream declarations
  14.  *
  15.  * $Id: stdiostr.h,v 1.1.1.1 1997/01/02 19:16:44 smarx Exp $
  16.  *
  17.  ****************************************************************************
  18.  *
  19.  * Rogue Wave Software, Inc.
  20.  * P.O. Box 2328
  21.  * Corvallis, OR 97339
  22.  * Voice: (503) 754-3010    FAX: (503) 757-6650
  23.  *
  24.  * Copyright (C) 1991,  1993, 1994.
  25.  * This software is subject to copyright protection under the laws of 
  26.  * the United States and other countries.
  27.  * ALL RIGHTS RESERVED
  28.  *
  29.  ***************************************************************************
  30.  *
  31.  * $Log: stdiostr.h,v $
  32.  * Revision 1.1.1.1  1997/01/02 19:16:44  smarx
  33.  * cafe12
  34.  *
  35. // * 
  36. // * 5     2/26/96 8:05a Smarx
  37.  * 
  38.  *    Rev 1.3   24 May 1995 15:42:16   Andrew
  39.  * Fixed problem where structs/classes were not in pragma pack(__DEFALIGN)
  40.  * 
  41.  *    Rev 1.2   08 Oct 1994 14:11:56   BUSHNELL
  42.  * Added pragma once for faster compilations
  43.  * 
  44.  *    Rev 1.1   02 Jun 1994 21:35:44   bushnell
  45.  * added ifdef so that MS RC will not include header twice
  46.  * 
  47.  
  48.  *    Rev 1.0   28 Apr 1994 19:17:46   thompson                   
  49.  
  50.  * Initial revision.
  51.  
  52.  * 
  53.  
  54.  *    Rev 1.0   20 Apr 1994 17:46:14   thompson                   
  55.  
  56.  * Initial revision.
  57.  
  58.  * Revision 1.1  1994/04/14  16:58:12  vriezen
  59.  * Initial revision
  60.  *
  61.  * Revision 1.2  1994/04/14  00:50:17  vriezen
  62.  * Updated copywrite, added ID and LOG and changed comments to indicate .cpp filename
  63.  *
  64.  *
  65.  * 
  66.  */
  67.  
  68. /* 
  69.     NOTE: These are inefficient and obsolete.  Use the standard classes
  70.       and functions in <fstream.h> instead.
  71. */
  72.  
  73.  
  74. #include <iostream.h>
  75. #include <stdio.h>
  76.  
  77. #pragma pack(__DEFALIGN)
  78.  
  79. class stdiobuf : public streambuf {
  80. public:
  81.         stdiobuf(FILE*);
  82.     FILE*    stdiofile();
  83.         ~stdiobuf();
  84.  
  85. virtual    int    overflow(int=EOF);
  86. virtual    int    pbackfail(int);
  87. virtual    int    sync();
  88. virtual    streampos seekoff(streamoff, ios::seek_dir, int);
  89. virtual    int    underflow();
  90.  
  91. private:
  92.     FILE*    sio;            
  93.     char    lahead[2];
  94. };
  95. inline    FILE*    stdiobuf::stdiofile() { return sio; }
  96.  
  97.  
  98. class stdiostream : public ios {
  99. public:
  100.         stdiostream(FILE*);
  101.         ~stdiostream();
  102.     stdiobuf* rdbuf();
  103.  
  104. private:
  105.     stdiobuf buf;
  106. };
  107. inline    stdiobuf* stdiostream::rdbuf() { return &buf; }
  108.  
  109. #pragma pack()
  110.  
  111. #endif /* _STDSTREAM_H_ */
  112.