Module: Advanced Tools Package: Streams
RWCharToStreambufOutputStreamImp RWCharOutputStreamImp RWOutputStreamImp RWStreamImp RWBodyBase
close() flush() getSinkBuff() |
isBad() isFail() isGood() |
make() RWCharToStreambufOutputStreamImp() write() |
~RWCharToStreambufOutputStreamImp() |
#include <rw/stream/RWCharToStreambufOutputStreamImp.h>
Concrete class connecting a narrow character stream, to an iostreams narrow character buffer. The iostreams buffer is used as sink for the data written to the narrow character stream. Implements the body idiom from the handle-body pattern.
RWCharToStreambufOutputStreamImp(streambuf& sinkBuff);
Initializes the reference to the iostreams std::streambuf, that will be used as the sink of narrow characters.
Parameter List
sinkBuff |
The iostreams std::streambuf that will serve as the sink of narrow characters. |
virtual ~RWCharToStreambufOutputStreamImp();
Destructor.
static RWCharOutputStream make(streambuf& sink);
Constructs an RWCharToStreambufOutputStreamImp instance that uses sink as its sink of narrow characters, and returns a handle to it. Throws no exceptions.
Parameter List
sink |
The iostreams std::streambuf that is used as the sink of narrow characters. |
virtual void close();
This function calls flush(). The user is responsible for closing the iostreams std::streambuf used as the sink of narrow characters if necessary. Throws exception RWExternalStreamException and propagates any other exception thrown by the internal iostreams stream buffer object.
virtual void flush();
Forward the flush request to the iostreams std::streambuf. Throws exception RWExternalStreamException and propagates any other exception thrown by the internal iostreams stream buffer object.
virtual bool isBad() const;
Returns true if the last operation performed on the iostreams std::streambuf failed. Throws no exceptions.
virtual bool isFail() const;
Returns true if the last operation performed on the iostreams std::streambuf failed. Throws no exceptions.
virtual bool isGood() const;
Returns true if the last operation performed on the iostreams std::streambuf succeeded. Throws no exceptions.
virtual void write(char charValue);
Writes a single narrow character to the iostreams std::streambuf. Throws exception RWExternalStreamException and propagates any other exception thrown by the internal iostreams stream buffer object.
Parameter List
charValue |
The narrow character to be written. |
virtual void write(const char* charArray, RWSize numChars);
Writes an array of narrow characters to the iostreams std::streambuf. Throws exception RWIncompleteStreamOperation and propagates any other exception thrown by the internal iostreams stream buffer object.
Parameter List
charArray |
A pointer to the first element of the array. |
numChars |
The number of narrow characters to be written. |
streambuf& getSinkBuff(); const streambuf& getSinkBuff() const;
These functions return a reference to the iostreams std::streambuf, which is used as the sink of narrow characters. Throws no exceptions.
© 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.