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 / VirtualHFSMacFile.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-07-28  |  2.2 KB  |  76 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        VirtualHFSMacFile.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 __VIRTUALHFSMACFILE__
  15. #define __VIRTUALHFSMACFILE__
  16.  
  17. #ifndef __VIRTUALMACFILE__
  18. #include "VirtualMacFile.h"
  19. #endif
  20.  
  21. #pragma push
  22. #pragma segment VirtualHFSMacFile
  23.  
  24. /***********************************|****************************************/
  25.  
  26. class TVirtualHFSMacFile  : public TVirtualMacFile 
  27. {
  28. public:
  29.             TVirtualHFSMacFile ( const FSSpec& storage, OSType creator = 'MPS ', OSType fileType = 'TEXT' );
  30.     virtual ~TVirtualHFSMacFile();
  31.     
  32.     virtual OSErr                     Open ();
  33.     virtual OSErr                     Close ();
  34.     
  35.     virtual Boolean                 GetDisposeFile();
  36.     virtual void                     SetDisposeFile(Boolean);
  37.     
  38.     virtual OSErr                     ReadData (void* buffer,long& count,ForkType whichFork);
  39.     virtual OSErr                     WriteData (const void* buffer, long& count, ForkType whichFork);
  40.     
  41.     virtual OSErr                     SetEnd (long logEof, ForkType whichFork);
  42.     virtual OSErr                     GetEnd (long& logEof, ForkType whichFork) const;
  43.     
  44.     virtual OSErr                     SetPosition (short posMode, long posOff, ForkType whichFork);
  45.     virtual OSErr                     GetPosition (long& filePos,ForkType whichFork) const;
  46.     
  47.     virtual OSErr                     SetFinderInfo (const FInfo& finderInfo);
  48.     virtual OSErr                     GetFinderInfo (FInfo& finderInfo) const;
  49.     
  50.     virtual OSErr                     GetDate (unsigned long& dateTime,WhichDateType whichDate) const;
  51.     virtual OSErr                     SetDate (unsigned long dateTime,WhichDateType whichDate);
  52.  
  53.     virtual    OSErr                    GetSpec ( FSSpec& ) const;
  54.     virtual    OSErr                    SetSpec ( const FSSpec& );
  55.  
  56.     virtual void                     SetUserRef(long ref);
  57.     virtual long                     GetUserRef() const;
  58.  
  59.     virtual OSErr                     WriteToDisk ( const FSSpec& );
  60.     virtual OSErr                     WriteToDisk ();
  61.     
  62. protected:    short                     GetRefNum(ForkType whichFork) const { return whichFork == kResource ? fRFRefnum : fDFRefnum; };
  63.  
  64.             FSSpec                     fSpec;
  65.             short                     fDFRefnum;
  66.             short                     fRFRefnum;
  67.             long                     fUserRef;
  68.             Boolean                 fDisposeFile;
  69. };
  70.  
  71. /***********************************|****************************************/
  72.  
  73. #pragma pop
  74.  
  75. #endif    // __VIRTUALHFSMACFILE__
  76.