home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Tool Chest / Apple Developer CD Series Tool Chest February 1996 (Apple Computer)(1996).iso / Sample Code / AOCE Sample Code / PowerTalk Access Modules / Sample SMSAM / SampleSMSAM Source / VirtualFile / VirtualASMacFile.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-07-28  |  3.0 KB  |  87 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        VirtualASMacFile.h
  3.  
  4.     Copyright:    © 1991-1994 by Apple Computer, Inc.
  5.                 All rights reserved.
  6.  
  7.     Part of the AOCE Sample SMSAM Package.  Consult the license
  8.     which came with this software for your specific legal rights.
  9.  
  10. */
  11.  
  12.  
  13.  
  14. #ifndef __VIRTUALAPPLESINGLEMACFILE__
  15. #define __VIRTUALAPPLESINGLEMACFILE__
  16.  
  17. #ifndef __VIRTUALMACFILE__
  18. #include "VirtualMacFile.h"
  19. #endif
  20.  
  21. class TVirtualFile;
  22.  
  23. /***********************************|****************************************/
  24.  
  25. class TVirtualAppleSingleMacFile : public TVirtualMacFile
  26. {
  27. public:
  28.             TVirtualAppleSingleMacFile(TVirtualFile* dataFile);
  29.     virtual ~TVirtualAppleSingleMacFile();
  30.  
  31.     //    Validation of the AppleSingle file.  If this function returns true, then this is a valid
  32.     //    AppleSingle format file, and operations on it should succeed.  If this return false, then
  33.     //    the 'base' data file (passed into the initializer) is NOT an AppleSingle format file, and
  34.     //    most operations on this file will FAIL.
  35.             Boolean                 IsValidAppleSingleFile () const;
  36.  
  37.     virtual OSErr                     Open ();
  38.     virtual OSErr                     Close ();
  39.  
  40.     virtual OSErr                     ReadData (void* buffer,long& count,TVirtualMacFile::ForkType whichFork); // Read count bytes from file to buffer
  41.     virtual OSErr                     WriteData (const void* buffer, long& count, TVirtualMacFile::ForkType whichFork); // Write count bytes from buffer to the file
  42.  
  43.     virtual OSErr                     SetEnd (long logEof, TVirtualMacFile::ForkType whichFork); // Set the EOF for the file to logEof
  44.     virtual OSErr                     GetEnd (long& logEof, TVirtualMacFile::ForkType whichFork) const; // Return the length of the file in logEof
  45.  
  46.     virtual OSErr                     SetPosition (short posMode, long posOff, TVirtualMacFile::ForkType whichFork);  // Set the position of the mark in the file
  47.     virtual OSErr                     GetPosition (long& filePos,TVirtualMacFile::ForkType whichFork) const;      // Get the position of the mark in the file
  48.  
  49.     virtual OSErr                     SetFinderInfo (const FInfo& finderInfo); // Sets information used by the Finder
  50.     virtual OSErr                     GetFinderInfo (FInfo& finderInfo) const; // Get information used by the Finder
  51.  
  52.     virtual void                     SetUserRef(long ref); // Set the user ref for the file
  53.      virtual long                     GetUserRef() const; // Get user ref for the file
  54.  
  55.     virtual OSErr                     SetDate (unsigned long dateTime,WhichDateType whichDate);
  56.     virtual OSErr                     GetDate (unsigned long& dateTime,WhichDateType whichDate) const;
  57.  
  58.     virtual    OSErr                    GetSpec ( FSSpec& ) const;
  59.     virtual    OSErr                    SetSpec ( const FSSpec& );
  60.  
  61. private:
  62.     TVirtualFile*                        fAppleSingleBaseFile;
  63.     
  64.     Str31                                fFileName;
  65.     
  66.     long                                fDataForkOffset,
  67.                                         fDataForkLength,
  68.                                         fDataForkFPos;
  69.                                         
  70.     long                                fResourceForkOffset,
  71.                                         fResourceForkLength,
  72.                                         fResourceForkFPos;
  73.                                         
  74.     FInfo                                fFinderInfo;
  75.     
  76.     unsigned long                        fCreationDate,
  77.                                         fModificationDate,
  78.                                         fBackupDate;
  79.                                         
  80.     long                                fUserRefNum;
  81. };
  82.  
  83. /***********************************|****************************************/
  84.  
  85. #endif // __VIRTUALAPPLESINGLEMACFILE__
  86.  
  87.