home *** CD-ROM | disk | FTP | other *** search
/ Computer Panoráma / computer_panorama_1997-12-hibas.iso / SHARE / GRAPH / PTC051.ZIP / SRC / FILE.H < prev    next >
C/C++ Source or Header  |  1997-08-03  |  1KB  |  66 lines

  1. ////////////////
  2. // File class //
  3. ////////////////
  4.  
  5. #ifndef __FILE_H
  6. #define __FILE_H
  7.  
  8. #include "list.h"
  9. #include <stdio.h>
  10.  
  11.  
  12.  
  13.                    
  14.                   
  15.  
  16.            
  17. class File
  18. {
  19.     public:
  20.         // setup
  21.         File();
  22.         File(char *filename,char *mode=NULL);
  23.         ~File();
  24.  
  25.         // open and close
  26.         int open(char *filename,char *mode=NULL);
  27.         int close();
  28.  
  29.         // packfile
  30.         int addpack(char packfile[]);
  31.         int pack(char packfile[]);
  32.         void resetpacks();
  33.  
  34.         // user functions
  35.         int seek(long offset,int origin=SEEK_CUR);
  36.         int read(void *buffer,unsigned bytes);
  37.         int write(void *buffer,unsigned bytes);
  38.         int puts(char *string);
  39.         int eof();
  40.         int size();
  41.  
  42.         // status
  43.         int ok() const;
  44.  
  45.     protected:
  46.  
  47.         // file handle
  48.         FILE *handle;
  49.  
  50.         // packfile (0=no, 1=yes)      
  51.         int packfile; 
  52.  
  53.         // registered pack files
  54.         static List<char> packfiles; 
  55. };
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66. #endif