home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / cset21v1.zip / IBMCPP / INCLUDE / STRSTREA.H < prev    next >
Text File  |  1993-09-17  |  7KB  |  151 lines

  1. #pragma info( none )
  2. #ifndef __CHKHDR__
  3.    #pragma info( none )
  4. #endif
  5. #pragma info( restore )
  6.  
  7. #ifndef __strstream_h
  8.    #define __strstream_h
  9.  
  10.    /********************************************************************/
  11.    /*  <strstrea.h> header file                                        */
  12.    /*                                                                  */
  13.    /*  Licensed Materials - Property of IBM                            */
  14.    /*                                                                  */
  15.    /*  IBM C/C++ Tools Version 2.01                                    */
  16.    /*  Copyright (C) International Business Machines Corp., 1991, 1993.*/
  17.    /*  All rights reserved                                             */
  18.    /*                                                                  */
  19.    /*                                                                  */
  20.    /*                                                                  */
  21.    /*  Licensed Materials - Property of USL                            */
  22.    /*                                                                  */
  23.    /*  Standard Class Library Version 3.0                              */
  24.    /*  Copyright (C) Unix System Laboratories Inc. 1991.               */
  25.    /*  All rights reserved                                             */
  26.    /*                                                                  */
  27.    /********************************************************************/
  28.  
  29.    /**************************************************************************/
  30.    /*  C++ source for the C++ Language System, Release 3.0.  This product    */
  31.    /*  is a new release of the original cfront developed in the computer     */
  32.    /*  science research center of AT&T Bell Laboratories.                    */
  33.    /*                                                                        */
  34.    /*  Copyright (c) 1991 AT&T and UNIX System Laboratories, Inc.            */
  35.    /*  Copyright (c) 1984, 1989, 1990 AT&T.  All Rights Reserved.            */
  36.    /*                                                                        */
  37.    /*  THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE of AT&T and UNIX System   */
  38.    /*  Laboratories, Inc.  The copyright notice above does not evidence      */
  39.    /*  any actual or intended publication of such source code.               */
  40.    /*                                                                        */
  41.    /*  UNIX is a registered trademark of UNIX System Laboratories, Inc.      */
  42.    /*                                                                        */
  43.    /*  ident "@(#)ctrans:incl-master/const-headers/strstream.h       1.7"    */
  44.    /**************************************************************************/
  45.  
  46.    #include <iostream.h>
  47.  
  48.    #pragma pack(4)
  49.  
  50.    class strstreambuf : public streambuf
  51.    {
  52.    public:
  53.                            strstreambuf() ;
  54.                            strstreambuf(int) ;
  55.                            strstreambuf(void* (*a)(long), void (*f)(void*)) ;
  56.                            strstreambuf(char* b, int size, char* pstart = 0 ) ;
  57.                            strstreambuf(signed char* b, int size, signed char* pstart = 0 ) ;
  58.                            strstreambuf(unsigned char* b, int size, unsigned char* pstart = 0 ) ;
  59.  
  60.            /*
  61.             FUNCTION  int streambuf::pcount() IS INTERNAL AND SHOULD
  62.             NOT BE USED.
  63.            */
  64.            int             pcount();
  65.  
  66.            void            freeze(int n=1) ;
  67.            char*           str() ;
  68.                            ~strstreambuf() ;
  69.  
  70.    public: /* virtuals  */
  71.            virtual int     doallocate() ;
  72.            virtual int     overflow(int) ;
  73.            virtual int     underflow() ;
  74.            virtual streambuf*
  75.                            setbuf(char*  p, int l) ;
  76.            virtual streampos
  77.                            seekoff(streamoff,ios::seek_dir,int) ;
  78.  
  79.    private:
  80.            void            init(char*,int,char*) ;
  81.  
  82.            void*           (*afct)(long) ;
  83.            void            (*ffct)(void*) ;
  84.            int             ignore_oflow ;
  85.            int             froozen ;
  86.            int             auto_extend ;
  87.  
  88.    public:
  89.            int             isfrozen() { return froozen; }
  90.            } ;
  91.  
  92.    class strstreambase : public virtual ios {
  93.    public:
  94.            strstreambuf*   rdbuf() ;
  95.    protected:
  96.                            strstreambase(char*, int, char*) ;
  97.                            strstreambase() ;
  98.                            ~strstreambase() ;
  99.    private:
  100.            strstreambuf    buf ;
  101.            } ;
  102.  
  103.    class istrstream : public strstreambase, public istream {
  104.    public:
  105.                            istrstream(char* str);
  106.                            istrstream(signed char* str);
  107.                            istrstream(unsigned char* str);
  108.                            istrstream(char* str, int size ) ;
  109.                            istrstream(signed char* str, int size);
  110.                            istrstream(unsigned char* str, int size);
  111.                            istrstream(const char* str);
  112.                            istrstream(const signed char* str);
  113.                            istrstream(const unsigned char* str);
  114.                            istrstream(const char* str, int size ) ;
  115.                            istrstream(const signed char* str, int size);
  116.                            istrstream(const unsigned char* str, int size);
  117.                            ~istrstream() ;
  118.            } ;
  119.  
  120.    class ostrstream : public strstreambase, public ostream {
  121.    public:
  122.                            ostrstream(char* str, int size, int=ios::out) ;
  123.                            ostrstream(signed char* str, int size, int=ios::out) ;
  124.                            ostrstream(unsigned char* str, int size, int=ios::out) ;
  125.                            ostrstream() ;
  126.                            ~ostrstream() ;
  127.            char*           str() ;
  128.            int             pcount() ;
  129.            } ;
  130.  
  131.  
  132.    class strstream : public strstreambase, public iostream {
  133.    public:
  134.                            strstream() ;
  135.                            strstream(char* str, int size, int mode) ;
  136.                            strstream(signed char* str, int size, int mode) ;
  137.                            strstream(unsigned char* str, int size, int mode) ;
  138.                            ~strstream() ;
  139.            char*           str() ;
  140.            } ;
  141.  
  142.    #pragma pack()
  143.  
  144. #endif
  145.  
  146. #pragma info( none )
  147. #ifndef __CHKHDR__
  148.    #pragma info( restore )
  149. #endif
  150. #pragma info( restore )
  151.