SourcePro C++ 12.0 |
SourcePro® C++ API Reference Guide |
SourcePro C++ Documentation Home |
Concrete class connecting a binary stream to an iostreams narrow character buffer. More...
#include <rw/stream/RWByteToStreambufOutputStreamImp.h>
Public Member Functions | |
virtual | ~RWByteToStreambufOutputStreamImp () |
virtual void | close () |
virtual void | flush () |
virtual bool | isBad () const |
virtual bool | isFail () const |
virtual bool | isGood () const |
virtual void | write (RWByte byteValue) |
virtual void | write (const RWByte *byteArray, RWSize numBytes) |
Static Public Member Functions | |
static RWByteOutputStream | make (std::streambuf &sink) |
Protected Member Functions | |
RWByteToStreambufOutputStreamImp (std::streambuf &sinkBuff) | |
std::streambuf & | getSinkBuff () |
const std::streambuf & | getSinkBuff () const |
Concrete class connecting a binary stream to an iostreams narrow character buffer. The iostreams buffer is used as the sink for the data written to the binary stream. The iostreams buffer must be opened in binary mode. Implements the body idiom from the handle-body pattern.
virtual RWByteToStreambufOutputStreamImp::~RWByteToStreambufOutputStreamImp | ( | ) | [virtual] |
Destructor.
RWByteToStreambufOutputStreamImp::RWByteToStreambufOutputStreamImp | ( | std::streambuf & | sinkBuff | ) | [inline, protected] |
Initializes the reference to the iostreams std::streambuf
, used as the sink of bytes.
sinkBuff | The iostreams std::streambuf that will serve as the sink of bytes. |
virtual void RWByteToStreambufOutputStreamImp::close | ( | ) | [virtual] |
This function calls flush(). The user is responsible for closing the iostreams std::streambuf
used as the sink of bytes, if necessary. Throws RWExternalStreamException and propagates any other exception thrown by the internal std::iostreams
streambuf object.
Reimplemented from RWOutputStreamImp.
virtual void RWByteToStreambufOutputStreamImp::flush | ( | ) | [virtual] |
Forward the flush request to the iostreams std::streambuf
. Throws RWExternalStreamException and propagates any other exception thrown by the internal iostreams std::streambuf
object.
Implements RWOutputStreamImp.
const std::streambuf& RWByteToStreambufOutputStreamImp::getSinkBuff | ( | ) | const [inline, protected] |
Returns a const reference to the iostreams std::streambuf
, which is used as the sink of bytes.
std::streambuf& RWByteToStreambufOutputStreamImp::getSinkBuff | ( | ) | [inline, protected] |
Returns a reference to the iostreams std::streambuf
, which is used as the sink of bytes.
virtual bool RWByteToStreambufOutputStreamImp::isBad | ( | ) | const [virtual] |
Returns true
if the last operation performed on the iostreams std::streambuf
failed.
Implements RWStreamImp.
virtual bool RWByteToStreambufOutputStreamImp::isFail | ( | ) | const [virtual] |
Returns true
if the last operation performed on the iostreams std::streambuf
failed.
Implements RWStreamImp.
virtual bool RWByteToStreambufOutputStreamImp::isGood | ( | ) | const [virtual] |
Returns true
if the last operation performed on the iostreams std::streambuf
succeeded.
Implements RWStreamImp.
static RWByteOutputStream RWByteToStreambufOutputStreamImp::make | ( | std::streambuf & | sink | ) | [inline, static] |
Constructs an RWByteToStreambufOutputStreamImp instance that uses sink as its sink of bytes, and returns a handle to it. Throws no exceptions.
sink | The iostreams std::streambuf that is used as the sink of bytes. |
virtual void RWByteToStreambufOutputStreamImp::write | ( | const RWByte * | byteArray, | |
RWSize | numBytes | |||
) | [virtual] |
Writes an array of bytes to the iostreams std::streambuf
. Throws exception RWIncompleteStreamOperation and propagates any other exception thrown by the internal iostreams std::streambuf
object.
byteArray | A pointer to the first element of the array. | |
numBytes | The number of bytes to be written. |
Implements RWByteOutputStreamImp.
virtual void RWByteToStreambufOutputStreamImp::write | ( | RWByte | byteValue | ) | [virtual] |
Writes a single byte to the iostreams std::streambuf
. Throws exception RWExternalStreamException and propagates any other exception thrown by the internal iostreams std::streambuf
object.
byteValue | The byte to be written. |
Implements RWByteOutputStreamImp.
© 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.