Module: Advanced Tools Package: Streams
RWChainedUCharArrayOutputStreamImp RWUCharArrayOutputStreamImp RWUCharOutputStreamImp RWOutputStreamImp RWStreamImp RWBodyBase
clear() close() flush() getSinkBuff() |
getUCharacterArray() getUCharacterArraySize() isBad() isFail() |
isGood() make() RWChainedUCharArrayOutputStreamImp() write() |
~RWChainedUCharArrayOutputStreamImp() |
#include <rw/stream/RWChainedUCharArrayOutputStreamImp.h>
Concrete class implementing the UTF-16 character array output stream interface. UTF-16 characters inserted into an instance of class RWChainedUCharArrayOutputStreamImp are stored in memory using an instance of class RWChainedMemoryStreambuf. Implements the body idiom from the handle-body pattern.
RWChainedUCharArrayOutputStreamImp();
Constructor.
virtual ~RWChainedUCharArrayOutputStreamImp();
Destructor.
static RWUCharArrayOutputStream make();
Constructs an RWChainedUCharArrayOutputStreamImp instance that uses an instance of class RWChainedMemoryStreambuf to store UTF-16 characters. The function returns a handle to the implementation class.
virtual void clear();
Resets the underlying buffer.
virtual void close();
This function calls flush().
virtual void flush();
Forward the flush() request to the internal RWChainedMemoryStreambuf object.
virtual RWSize getUCharacterArraySize() const;
Returns the size of the UTF-16 character array that would be returned by a call to function getUCharacterArray().
virtual RWUChar* getUCharacterArray();
Returns a pointer to an array of UTF-16 characters containing the UTF-16 characters inserted into the stream since its creation, or since the last invocation of function getUCharacterArray(), or function clear(). Users are responsible for freeing the memory associated with the array returned by this function, by using operator delete[].
virtual bool isBad() const; virtual bool isFail() const;
These functions return true if the last operation performed on the internal RWChainedMemoryStreambuf object failed.
virtual bool isGood() const;
Returns true if the last operation performed on the internal RWChainedMemoryStreambuf object succeeded.
virtual void write(RWUChar unicodeValue);
Writes a single UTF-16 character to the stream. Throws exception RWIncompleteStreamOperation.
Parameter List
unicodeValue |
The UTF-16 character to be written. |
virtual void write(const RWUChar* unicodeArray, RWSize numUChars);
Writes an array of UTF-16 characters to the stream. Throws exception RWIncompleteStreamOperation.
unicodeArray |
A pointer to the first element of the array. |
numUChars |
The number of UTF-16 characters to be written. |
RWChainedMemoryStreambuf& getSinkBuff(); const RWChainedMemoryStreambuf& getSinkBuff() const;
These functions return a reference to the RWChainedMemoryStreambuf, which is used as the sink of UTF-16 characters.
© 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.