home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / include / ifilstrm.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-22  |  3.2 KB  |  86 lines

  1. #ifndef _IFILSTRM_
  2. #define _IFILSTRM_
  3. /*******************************************************************************
  4. * FILE NAME: ifilstrm.hpp                                                      *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   Declaration of class(es):                                                  *
  8. *     IFileStream                                                              *
  9. *                                                                              *
  10. * COPYRIGHT:                                                                   *
  11. *   IBM Open Class Library                                                     *
  12. *   (C) Copyright International Business Machines Corporation 1992, 1996       *
  13. *   Licensed Material - Program-Property of IBM - All Rights Reserved.         *
  14. *   US Government Users Restricted Rights - Use, duplication, or disclosure    *
  15. *   restricted by GSA ADP Schedule Contract with IBM Corp.                     *
  16. *                                                                              *
  17. *                                                                              *
  18. *******************************************************************************/
  19. #include <ibasstrm.hpp>
  20. #include <fstream.h>
  21.  
  22. #pragma pack(4)
  23.  
  24.  
  25. class IFileStream : public IBaseStream {
  26. typedef IBaseStream
  27.   Inherited;
  28. public:
  29. /*------------------------------- Constructors -------------------------------*/
  30.   IFileStream   ( const char* fileName,
  31.                   Boolean     writeable = true);
  32. virtual
  33.  ~IFileStream   ( );
  34.  
  35. /*------------------------ Stream  Flushing ----------------------------------*/
  36. virtual IFileStream
  37.  &flush        ( );
  38.  
  39. /*------------------------ Random Access -------------------------------------*/
  40. virtual IBaseStream::Position
  41.   position              ( ) const,
  42.   logicalEndOfStream    ( ) const,
  43.   physicalEndOfStream   ( ) const;
  44. virtual IFileStream
  45.  &seek                  ( IBaseStream::Position position ),
  46.  &setLogicalEndOfStream ( IBaseStream::Position position );
  47.  
  48. /*------------------------Write Access ---------------------------------------*/
  49. virtual Boolean
  50.   isWriteable() const;
  51.  
  52.  
  53. protected:
  54. /*------------------------ Buffer Management Overrides -----------------------*/
  55. virtual void
  56.   handleWriteBufferFull ( const void*    source,
  57.                           size_t         byteCount ),
  58.   handleReadBufferEmpty ( void*          target,
  59.                           size_t         byteCount );
  60.  
  61. /*------------------------ Random Access -------------------------------------*/
  62. virtual IFileStream
  63.  &setPhysicalEndOfStream ( IBaseStream::Position position );
  64.  
  65. private:
  66. /*------------------------------ Hidden Members ------------------------------*/
  67.   IFileStream ( );
  68.   IFileStream ( const IFileStream& copy);
  69. IFileStream
  70.  &operator=   ( const IFileStream& copy);
  71.  
  72. /*----------------------------- Private --------------------------------------*/
  73. IString
  74.   fName;
  75. Boolean
  76.   fWriteable;
  77. filebuf
  78.   fBuffer;
  79.  
  80. };  // IFileStream
  81.  
  82.  
  83. #pragma pack()
  84.  
  85. #endif /* _IFILSTRM_ */
  86.