Tools.h++ Class Reference

Table Of Contents
Click on the banner to return to the Class Reference home page.
©Copyright 1996 Rogue Wave Software
RWCLIPstreambuf
RWCLIPstreambuf streambuf
Synopsis
Description
Persistence
Example
Public Constructors
Public Destructor
Public Member Functions
Synopsis
#include <rw/winstrea.h>
#include <iostream.h>
iostream str( new RWCLIPstreambuf() );
Description
Class RWCLIPstreambuf is a specialized streambuf that gets and puts sequences of characters to
Microsoft Windows global memory. It can be used to exchange data through Windows clipboard
facility.
The class has two modes of operation: dynamic and static. In dynamic mode, memory is allocated
and reallocated as needed. If too many characters are inserted into the internal buffer for its present
size, then it will be resized and old characters copied over into any new memory as necessary. This
is transparent to the user. It is expected that this mode would be used primarily for "insertions," i.e.,
clipboard "cuts" and "copies." In static mode, the buffer streambuf is constructed from a specific
piece of memory. No reallocations will be done. It is expected that this mode would be used
primarily for "extractions," i.e., clipboard "pastes."
In dynamic mode, the RWCLIPstreambuf "owns" any allocated memory until the member function
str() is called, which "freezes" the buffer and returns an unlocked Windows handle to it. The effect
of any further insertions is undefined. Until str() has been called, it is the responsibility of the