home *** CD-ROM | disk | FTP | other *** search
- /*
- File: VirtualASMacFile.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 __VIRTUALAPPLESINGLEMACFILE__
- #define __VIRTUALAPPLESINGLEMACFILE__
-
- #ifndef __VIRTUALMACFILE__
- #include "VirtualMacFile.h"
- #endif
-
- class TVirtualFile;
-
- /***********************************|****************************************/
-
- class TVirtualAppleSingleMacFile : public TVirtualMacFile
- {
- public:
- TVirtualAppleSingleMacFile(TVirtualFile* dataFile);
- virtual ~TVirtualAppleSingleMacFile();
-
- // Validation of the AppleSingle file. If this function returns true, then this is a valid
- // AppleSingle format file, and operations on it should succeed. If this return false, then
- // the 'base' data file (passed into the initializer) is NOT an AppleSingle format file, and
- // most operations on this file will FAIL.
- Boolean IsValidAppleSingleFile () const;
-
- virtual OSErr Open ();
- virtual OSErr Close ();
-
- virtual OSErr ReadData (void* buffer,long& count,TVirtualMacFile::ForkType whichFork); // Read count bytes from file to buffer
- virtual OSErr WriteData (const void* buffer, long& count, TVirtualMacFile::ForkType whichFork); // Write count bytes from buffer to the file
-
- virtual OSErr SetEnd (long logEof, TVirtualMacFile::ForkType whichFork); // Set the EOF for the file to logEof
- virtual OSErr GetEnd (long& logEof, TVirtualMacFile::ForkType whichFork) const; // Return the length of the file in logEof
-
- virtual OSErr SetPosition (short posMode, long posOff, TVirtualMacFile::ForkType whichFork); // Set the position of the mark in the file
- virtual OSErr GetPosition (long& filePos,TVirtualMacFile::ForkType whichFork) const; // Get the position of the mark in the file
-
- virtual OSErr SetFinderInfo (const FInfo& finderInfo); // Sets information used by the Finder
- virtual OSErr GetFinderInfo (FInfo& finderInfo) const; // Get information used by the Finder
-
- virtual void SetUserRef(long ref); // Set the user ref for the file
- virtual long GetUserRef() const; // Get user ref for the file
-
- virtual OSErr SetDate (unsigned long dateTime,WhichDateType whichDate);
- virtual OSErr GetDate (unsigned long& dateTime,WhichDateType whichDate) const;
-
- virtual OSErr GetSpec ( FSSpec& ) const;
- virtual OSErr SetSpec ( const FSSpec& );
-
- private:
- TVirtualFile* fAppleSingleBaseFile;
-
- Str31 fFileName;
-
- long fDataForkOffset,
- fDataForkLength,
- fDataForkFPos;
-
- long fResourceForkOffset,
- fResourceForkLength,
- fResourceForkFPos;
-
- FInfo fFinderInfo;
-
- unsigned long fCreationDate,
- fModificationDate,
- fBackupDate;
-
- long fUserRefNum;
- };
-
- /***********************************|****************************************/
-
- #endif // __VIRTUALAPPLESINGLEMACFILE__
-
-