home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / Libraries / Aidan's Class Libraries / Source / Headers / CLFile.h < prev    next >
Encoding:
Text File  |  1997-05-18  |  1.2 KB  |  59 lines  |  [TEXT/CWIE]

  1. //Copyright (c) 1997 Aidan Cully
  2. //All rights reserved
  3.  
  4. #ifndef __TFILES_H
  5. #define __TFILES_H
  6.  
  7. #include <Files.h>
  8. #include <Types.h>
  9.  
  10. class TBaseFile {
  11. protected:
  12.     FSSpec theFile;
  13.     Boolean hasFile;
  14. public:
  15.     TBaseFile();
  16.     virtual OSErr SetFile( FSSpec );
  17.     OSErr CreateNew( OSType, OSType, ScriptCode );
  18.     Boolean HasFile();
  19. };
  20.  
  21. class TDataFile: public virtual TBaseFile {
  22. private:
  23.     short fRef;
  24.     Boolean isOpenDF;
  25. public:
  26.     TDataFile();
  27.     OSErr OpenDF( SInt8 permission );
  28.     OSErr CloseDF();
  29.     OSErr ReadDF( void *, SInt32 );
  30.     OSErr WriteDF( void *, SInt32 );
  31.     OSErr GetFPos( SInt32 & );
  32.     OSErr SetFPos( short, SInt32 );
  33.     OSErr SetEOF( SInt32 );
  34.     Boolean IsOpenDF();
  35.     virtual OSErr SetFile( FSSpec );
  36.     short GetDFRef();
  37. };
  38.  
  39. class TResFile: public virtual TBaseFile {
  40. private:
  41.     short rRef;
  42.     Boolean isOpenRF;
  43.     static TResFile *presRes;
  44. public:
  45.     TResFile();
  46.     OSErr OpenRF( SInt8 perms );
  47.     OSErr CloseRF();
  48.     OSErr ReadRF( ResType theType, short index, Handle *data );
  49.     OSErr WriteRF( ResType theType, short index, Handle data );
  50.     Boolean IsOpenRF();
  51.     virtual OSErr SetFile( FSSpec );
  52.     short GetRFRef();
  53. };
  54.  
  55. class TFile: public TDataFile, public TResFile {
  56.     virtual OSErr SetFile( FSSpec );
  57. };
  58.  
  59. #endif