home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / dokpr1.zip / filestr.h < prev    next >
C/C++ Source or Header  |  1995-07-22  |  2KB  |  71 lines

  1. /**************************************************************************
  2.  *                                                                        *
  3.  *                                                                        *
  4.  *          This code is copyright (c) 1994                               *
  5.  *                     Athena Design, Inc.                                *
  6.  *                                                                        *
  7.  *                                                                        *
  8.  *                ALL RIGHTS RESERVED                                     *
  9.  *                                                                        *
  10.  *                                                                        *
  11.  *                                                                        *
  12.  *                                                                        *
  13.  *                                                                        *
  14.  **************************************************************************/
  15.  
  16. /*
  17.     this is a subclass of stream that handles the I/O to disk
  18.     6-1-94 dpp
  19.     94-09-19 dpp added makeBackup() function
  20. */
  21.  
  22. #ifndef _MH_fileStream
  23.  
  24. #define _MH_fileStream
  25.  
  26. #include "stream.h"
  27.  
  28. #include "os2h.h"
  29.  
  30. #ifdef M2MAC
  31. #include <stdio.h>
  32. #endif
  33.  
  34. class MFileStream : public MStream {
  35.     public:
  36.     MFileStream(int,const char *);
  37.     virtual ~MFileStream();
  38.  
  39.     virtual int write(const void *,int);
  40.     virtual int read(void *,int);
  41.     virtual int getPos();
  42.     virtual int getStreamLen();
  43.     virtual int seek(int);
  44.     virtual void setAttributes(const char *);
  45.     virtual void setMesaAttributes();
  46.     virtual int isEOF();
  47.  
  48.     private:
  49.     char *cache;
  50.     int blen,start,pos,rfp;
  51.  
  52. #if defined(M2Z)
  53.     HFILE file;
  54. #elif defined(M2NT)
  55.     HANDLE file;
  56. // #if defined(M2Z) || defined(M2NT)
  57. #elif defined(M2MAC)
  58.     FILE *file;
  59. #endif
  60.  
  61.  
  62.     void flushCache();
  63. };
  64.  
  65. // creates a backup of the named file with the given extension
  66. void makeBackup(const char *,const char *);
  67.  
  68.  
  69. // ifndef _MH_fileStream
  70. #endif
  71.