home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-05-18 | 1.2 KB | 59 lines | [TEXT/CWIE] |
- //Copyright (c) 1997 Aidan Cully
- //All rights reserved
-
- #ifndef __TFILES_H
- #define __TFILES_H
-
- #include <Files.h>
- #include <Types.h>
-
- class TBaseFile {
- protected:
- FSSpec theFile;
- Boolean hasFile;
- public:
- TBaseFile();
- virtual OSErr SetFile( FSSpec );
- OSErr CreateNew( OSType, OSType, ScriptCode );
- Boolean HasFile();
- };
-
- class TDataFile: public virtual TBaseFile {
- private:
- short fRef;
- Boolean isOpenDF;
- public:
- TDataFile();
- OSErr OpenDF( SInt8 permission );
- OSErr CloseDF();
- OSErr ReadDF( void *, SInt32 );
- OSErr WriteDF( void *, SInt32 );
- OSErr GetFPos( SInt32 & );
- OSErr SetFPos( short, SInt32 );
- OSErr SetEOF( SInt32 );
- Boolean IsOpenDF();
- virtual OSErr SetFile( FSSpec );
- short GetDFRef();
- };
-
- class TResFile: public virtual TBaseFile {
- private:
- short rRef;
- Boolean isOpenRF;
- static TResFile *presRes;
- public:
- TResFile();
- OSErr OpenRF( SInt8 perms );
- OSErr CloseRF();
- OSErr ReadRF( ResType theType, short index, Handle *data );
- OSErr WriteRF( ResType theType, short index, Handle data );
- Boolean IsOpenRF();
- virtual OSErr SetFile( FSSpec );
- short GetRFRef();
- };
-
- class TFile: public TDataFile, public TResFile {
- virtual OSErr SetFile( FSSpec );
- };
-
- #endif