home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1998 / MacHack 1998.toast / Sessions / Completions / Completions Source / Files / FileOutStream.h < prev    next >
Encoding:
Text File  |  1998-06-18  |  1.0 KB  |  57 lines  |  [TEXT/CWIE]

  1. // FileOutStream.h
  2.  
  3. #ifndef FileOutStream_h
  4. #define FileOutStream_h
  5.  
  6. #ifndef OutStream_h
  7. #include "OutStream.h"
  8. #endif
  9. #ifndef ParamBlockTask_h
  10. #include "ParamBlockTask.h"
  11. #endif
  12.  
  13. class FileWritingPath;
  14.  
  15. class FileOutStream: public OutStream,
  16.                             private ParamBlockTask
  17.   {
  18.     private:
  19.         bool flushing;
  20.         
  21.         virtual void Launch();
  22.         virtual void Kill();
  23.  
  24.         virtual void AtCompletion();
  25.     
  26.         enum { cacheBit = 16 };
  27.         enum { noCacheBit = 32 };
  28.     
  29.     protected:
  30.         virtual Task *NonblockingWrite( ConstData );
  31.         virtual Task *BlockingWrite( ConstData );
  32.  
  33.         virtual Task *FlushingTask();
  34.         
  35.     public:
  36.         FileOutStream();
  37.         ~FileOutStream()                    {}
  38.         
  39.         bool HasFile() const                { return ioParam.ioRefNum != 0; }
  40.         int16 File() const                { return ioParam.ioRefNum; }
  41.         
  42.         void SetFile( const FileWritingPath&, uint32 position = 0 );
  43.         void ClearFile();
  44.  
  45.         uint32 Position() const;
  46.         void SetPosition( uint32 p );
  47.         
  48.         void SuggestCaching();
  49.         void SuggestNoCaching();
  50.         void ClearCachingSuggestion();
  51.  
  52.         void VerifyWrites();
  53.         void DontVerifyWrites();
  54.   };
  55.  
  56. #endif
  57.