Module: Advanced Tools Package: Streams
RWChainedCharArrayOutputStreamImp RWCharArrayOutputStreamImp RWCharOutputStreamImp RWOutputStreamImp RWStreamImp RWBodyBase
#include <rw/stream/RWChainedCharArrayOutputStreamImp.h>
Concrete class implementing the narrow character array output stream interface. Characters inserted into an instance of class RWChainedCharArrayOutputStreamImp are stored in memory using an instance of class RWChainedMemoryStreambuf. Implements the body idiom from the handle-body pattern.
RWChainedCharArrayOutputStreamImp();
Constructor.
virtual ~RWChainedCharArrayOutputStreamImp();
Destructor.
static RWCharArrayOutputStream make();
Constructs an RWChainedCharArrayOutputStreamImp instance that uses an instance of class RWChainedMemoryStreambuf to store narrow characters. The function returns a handle to the implementation class.
virtual void clear();
Reset the underlying buffer.
virtual void close();
This function calls flush().
virtual void flush();
Forwards the flush() request to the internal RWChainedMemoryStreambuf object.
virtual RWSize getCharacterArraySize() const;
Returns the size of the narrow character array that would be returned by a call to function getCharacterArray().
virtual char* getCharacterArray();
Returns a pointer to an array of narrow characters containing the characters inserted into the stream since its creation, or since the last invocation of function getCharacterArray(), or function clear(). Users are responsible for freeing the memory associated with the array returned by this function using operator delete[].
virtual RWCString getString();
Returns a narrow character string object containing the characters inserted into the stream since its creation.
virtual bool isBad() const;
Returns true if the last operation performed on the internal RWChainedMemoryStreambuf object failed. Throws no exceptions.
virtual bool isFail() const;
Returns true if the last operation performed on the external RWChainedMemoryStreambuf object failed
virtual bool isGood() const;
Returns true if the last operation performed on the internal RWChainedMemoryStreambuf object succeeded.
virtual void write(char charValue);
Writes a single narrow character to the stream.
charValue |
The narrow character to be written to the stream. |
virtual void write(const char* charArray, RWSize numChars);
Writes an array of narrow characters to the stream.
Parameter List
charArray |
Pointer to the first element of the array. |
numChars |
The number of narrow characters to be written to the stream. |
RWChainedMemoryStreambuf& getSinkBuff(); const RWChainedMemoryStreambuf& getSinkBuff() const;
These functions return a reference to the RWChainedMemoryStreambuf, which is used as the sink of bytes.
© 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.