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

  1. /*
  2.     File:        RAMFile.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 __RAMFILE__
  15. #define __RAMFILE__
  16.  
  17. #ifndef __ABSTRACTFILE__
  18. #include "AbstractFile.h"
  19. #endif
  20.  
  21. #ifndef    __MEMORY__
  22. #include "Memory.h"
  23. #endif
  24.  
  25. /***********************************|****************************************/
  26.  
  27. class TRamFile : public TAbstractFile
  28. {
  29. public:
  30.             TRamFile ( unsigned long initialLength = 0, unsigned long growthRate = 1024 );
  31.     virtual ~TRamFile();
  32.  
  33.     virtual OSErr                     ReadData ( void*, long& );
  34.     virtual OSErr                     WriteData ( const void*, long& );
  35.  
  36.     virtual OSErr                     SetEnd ( long );
  37.     virtual OSErr                     GetEnd ( long& ) const;
  38.  
  39.     virtual OSErr                     SetPosition ( short posMode, long posOff );
  40.     virtual OSErr                     GetPosition ( long& filePos ) const;
  41.  
  42. protected:    TRamFile ( const TRamFile& );
  43.             TRamFile&        operator = ( const TRamFile& );
  44.             
  45.             Handle                    fHandle;
  46.             unsigned long            fPosition;
  47.             unsigned long            fLogicalLength;
  48.             unsigned long            fPhysicalLength;
  49.             unsigned long            fGrowthRate;
  50. };
  51.  
  52. /***********************************|****************************************/
  53.  
  54. #endif    // __RAMFILE__
  55.