home *** CD-ROM | disk | FTP | other *** search
- /*
- File: VirtualMacFile.h
-
- Copyright: © 1991-1994 by Apple Computer, Inc.
- All rights reserved.
-
- Part of the AOCE Sample SMSAM Package. Consult the license
- which came with this software for your specific legal rights.
-
- */
-
-
-
- #ifndef __VIRTUALMACFILE__
- #define __VIRTUALMACFILE__
-
- #ifndef __FILES__
- #include <Files.h>
- #endif
-
- #ifndef __HANDLEOBJECT__
- #include "HandleObject.h"
- #endif
-
- /***********************************|****************************************/
-
- class TVirtualMacFile : public THandleObject
- {
- public:
-
- enum WhichDateType { kCreationDate, kModDate };
- enum ForkType { kResource, kData };
-
- virtual ~TVirtualMacFile();
-
- virtual OSErr Open () = 0;
- virtual OSErr Close () = 0;
-
- virtual OSErr ReadData (void *buffer, long& count, ForkType whichFork) = 0;
- virtual OSErr WriteData (const void *buffer, long& count, ForkType whichFork) = 0;
-
- virtual OSErr SetEnd (long logEof, ForkType whichFork) = 0;
- virtual OSErr GetEnd (long& logEof, ForkType whichFork) const = 0;
-
- virtual OSErr SetPosition (short posMode, long posOff, ForkType whichFork) = 0;
- virtual OSErr GetPosition (long& filePos,ForkType whichFork) const = 0;
-
- virtual OSErr SetFinderInfo (const FInfo& finderInfo) = 0;
- virtual OSErr GetFinderInfo (FInfo& finderInfo) const = 0;
-
- virtual OSErr GetDate (unsigned long& dateTime,WhichDateType whichDate) const = 0;
- virtual OSErr SetDate (unsigned long dateTime,WhichDateType whichDate) = 0;
-
- virtual void SetUserRef(long ref) = 0;
- virtual long GetUserRef() const = 0;
-
- virtual OSErr WriteToDisk( const FSSpec& );
- virtual OSErr WriteToDisk ();
-
- virtual OSErr SetFileName(const Str31 name);
- virtual OSErr GetFileName(Str31 name) const;
-
- virtual OSErr GetSpec ( FSSpec& ) const = 0;
- virtual OSErr SetSpec ( const FSSpec& ) = 0;
-
- static OSErr GetFileInfo ( FSSpec&, HParamBlockRec& );
- static OSErr SetFileInfo ( FSSpec&, HParamBlockRec& );
-
- virtual TVirtualMacFile* Clone ();
- virtual OSErr Copy ( TVirtualMacFile* dest );
-
- virtual ostream& operator >> ( ostream& ) const;
-
- protected: TVirtualMacFile();
- TVirtualMacFile( const TVirtualMacFile& );
- TVirtualMacFile& operator = ( const TVirtualMacFile& );
-
- virtual OSErr CopyFork ( TVirtualMacFile::ForkType forkToCopy, TVirtualMacFile* dest );
- };
-
- /***********************************|****************************************/
-
- extern OSErr ChangeFileDates(const FSSpec& spec, long modDate, long creationDate);
-
- #endif // __VIRTUALMACFILE__
-
-