home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c082_144 / 8.ddi / IOSTRSR1.ZIP / FSBCTR3.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1992-06-10  |  1.4 KB  |  43 lines

  1. /*[]------------------------------------------------------------[]*/
  2. /*|                                                              |*/
  3. /*|     fsbctr3.cpp                                              |*/
  4. /*|                                                              |*/
  5. /*|     Class filebuf                                            |*/
  6. /*|          filebuf::filebuf( int, char *, int )                |*/
  7. /*|                                                              |*/
  8. /*[]------------------------------------------------------------[]*/
  9.  
  10. /*
  11.  *      C/C++ Run Time Library - Version 5.0
  12.  *
  13.  *      Copyright (c) 1990, 1992 by Borland International
  14.  *      All Rights Reserved.
  15.  *
  16.  */
  17.  
  18. #include <ioconfig.h>
  19. #include "filesys.h"
  20. #include <fstream.h>
  21.  
  22. // make a filebuf attached to an open fd -- assume fd is actually open
  23. // use buf as the buffer area
  24.  
  25. filebuf::filebuf(int f, signed char* buf, int len)
  26. {
  27.     xfd = f;        // assumed to be valid
  28.     opened = 1;     // unless we can find out otherwise
  29.     mode = 0;       // unless we can find out otherwise
  30.     last_seek = 0;
  31.     setbuf(buf, len);
  32. }
  33.  
  34. filebuf::filebuf(int f, unsigned char* buf, int len)
  35. {
  36.     xfd = f;        // assumed to be valid
  37.     opened = 1;     // unless we can find out otherwise
  38.     mode = 0;       // unless we can find out otherwise
  39.     last_seek = 0;
  40.     setbuf((signed char *)buf, len);
  41. }
  42.  
  43.