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

  1. #ifndef _IMEMSTRM_
  2. #define _IMEMSTRM_
  3. /*******************************************************************************
  4. * FILE NAME: imemstrm.hpp                                                      *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   Declaration of class(es):                                                  *
  8. *     IMemoryStream                                                            *
  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. * ADDITONAL COPYRIGHTS:                                                        *
  17. *  Copyright (C) 1996, Taligent, Inc. All rights reserved.                     *
  18. *  Copyright (C) 1996, Lotus Development Corporation. All Rights Reserved.     *
  19. *                                                                              *
  20. *                                                                              *
  21. *******************************************************************************/
  22. #include <ibasstrm.hpp>
  23.  
  24. #pragma pack(4)
  25.  
  26.  
  27. class IMemoryStream : public IBaseStream {
  28. typedef IBaseStream
  29.   Inherited;
  30.  
  31. public:
  32. /*------------------------------- Constructors -------------------------------*/
  33.   IMemoryStream( );
  34.   IMemoryStream( const void*   memory,
  35.                  size_t        byteCount );
  36. virtual
  37.  ~IMemoryStream();
  38.  
  39. /*------------------------ Random Access -------------------------------------*/
  40. virtual IBaseStream::Position
  41.   position             ( ) const,
  42.   physicalEndOfStream  ( ) const;
  43.  
  44. virtual IMemoryStream
  45.  &seek                 ( IBaseStream::Position position);
  46.  
  47. const char
  48.  *buffer();
  49.  
  50. protected:
  51. /*------------------------ Buffer Management Overrides -----------------------*/
  52. virtual void
  53.   handleWriteBufferFull  ( const void*    source,
  54.                            size_t         byteCount ),
  55.   handleReadBufferEmpty  ( void*          target,
  56.                            size_t         byteCount );
  57. IMemoryStream
  58.  &setPhysicalEndOfStream ( IBaseStream::Position position);
  59.  
  60. private:
  61. /*------------------------------ Hidden Members ------------------------------*/
  62.   IMemoryStream ( const IMemoryStream& copy);
  63. IMemoryStream
  64.  &operator=     ( const IMemoryStream& copy);
  65.  
  66. private:
  67. /*----------------------------- Private --------------------------------------*/
  68. char*
  69.   fBuffer;
  70. unsigned long
  71.   fPosition,
  72.   fCapacity;
  73.  
  74. }; // IMemoryStream
  75.  
  76.  
  77. #pragma pack()
  78.  
  79. #endif  // _IMEMSTRM_
  80.