Module: Advanced Tools Package: Streams
Does not inherit
#include <rw/stream/RWBufferedCharOutputStreamImp.h>
The typedef RWBufferedCharOutputStreamImp implements a buffer that can be used with narrow character output streams. The size of the buffer is specified in its static member make() function, which is used to create it. The buffer's role is to store narrow characters up to its maximum capacity, and then forward them to its associated synchronized stream. The buffer flushes itself upon destruction.
// This is an output buffer used for narrow character streams. #include <rw/stream/RWBufferedCharOutputStreamImp.h> #include <rw/stream/RWCharToStreambufOutputStreamImp.h> #include <rw/stream/RWStreambufToCharOutputStream.h> #include <fstream.h> #include <iostream.h> int main() { filebuf fbuf; fbuf.open("RWBufferedCharOutputStreamImp.out", ios::out); RWCharOutputStream charStream = RWCharToStreambufOutputStreamImp::make(fbuf); RWCharOutputStream bufferedStream = RWBufferedCharOutputStreamImp::make(charStream, 128); RWStreambufToCharOutputStream adaptor(bufferedStream); ostream out(&adaptor); int i = 63; out << i; return 0; }
typedef RWTOutputStreamBufferImp<RWCharOutputStream, RWFilteredCharOutputStreamImp> RWBufferedCharOutputStreamImp;
© Copyright Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.