Module: Advanced Tools Package: Streams
RWOstreamDataToCharOutputStreamImp RWDataToCharOutputStreamImp RWDataOutputStreamImp RWOutputStreamImp RWStreamImp RWBodyBase
#include <rw/stream/RWOstreamDataToCharOutputStreamImp.h>
The class RWOstreamDataToCharOutputStreamImp writes data in ascii format to a narrow character stream. The format generated is equivalent to the format generated by the iostreams ostream class. Implements the body idiom from the handle-body pattern.
RWOstreamDataToCharOutputStreamImp(RWCharOutputStream&
sinkStream);
Initializes the reference to the narrow character stream that will be used as the character sink.
Parameter List
sinkStream |
The narrow character stream that will serve as the character sink. |
RWOstreamDataToCharOutputStreamImp
(RWCharOutputStream& sinkStream, ios*& formatter);
Initializes the reference to the narrow character stream that will be used as the character sink.
Parameter List
sinkStream |
The narrow character stream that will serve as the sink of characters. |
formatter |
An object that can be used to modify the format generated by the stream. This object is initialized by the stream, and then returned to the caller. |
virtual ~RWOstreamDataToCharOutputStreamImp();
Destructor.
static RWDataOutputStream make(RWCharOutputStream& sink);
Constructs an RWOstreamDataToCharOutputStreamImp instance that uses sink as its sink of narrow characters and returns a handle to it. Throws no exceptions.
Parameter List
sink |
The narrow character stream that is used as the character sink. |
static RWDataOutputStream make(RWCharOutputStream& sink, RW_SL_IO_STD(ios)*& formatter);
Constructs an RWOstreamDataToCharOutputStreamImp instance that uses sink as its sink of narrow characters and returns a handle to it. Throws no exceptions.
Parameter List
sink |
The narrow character stream that is used as the character sink. |
formatter |
An object that can be used to modify the format generated by the stream. This object is initialized by the stream, and then returned to the caller. |
virtual void close();
Flushes the embedded iostreams ostream object and then forwards the closed call to the next processing narrow character output stream.
virtual void flush();
Flushes the embedded iostreams ostream object.
virtual bool isBad() const;
Returns true if either one of the embedded iostreams ostream objects or the next processing narrow character output stream object is in a bad state. Throws no exceptions.
virtual bool isFail() const;
Returns true if either one of the embedded iostreams ostream objects or the next processing narrow character output stream object is in a failed state. Throws no exceptions.
virtual bool isGood() const;
Returns true if both the embedded iostreams ostream object and the next processing narrow character output stream object are in a good state. Throws no exceptions.
virtual void putBool(bool value); virtual void putChar(char value); virtual void putDouble(double value); virtual void putFloat(float value); virtual void putInt(int value); virtual void putLong(long value); virtual void putLongDouble(long double value); virtual void putLongLong(long long value); virtual void putShort(short value); virtual void putSignedChar(signed char value); virtual void putUnsignedChar(unsigned char value); virtual void putUnsignedInt(unsigned int value); virtual void putUnsignedLong(unsigned long value); virtual void putUnsignedShort(unsigned short value); virtual void putWchar_t(wchar_t value);
These functions write a value to the narrow character stream, used as the data sink.
Parameter List
value |
The value to be written. |
virtual void putBools(const bool* arrayPt, RWSize count); virtual void putChars(const char* arrayPt, RWSize count); virtual void putDoubles(const double* arrayPt, RWSize count); virtual void putFloats(const float* arrayPt, RWSize count); virtual void putInts(const int* arrayPt, RWSize count); virtual void putLongs(const long* arrayPt, RWSize count); virtual void putLongDoubles(const long double* arrayPt, RWSize count); virtual void putLongLongs(const long long* arrayPt, RWSize count); virtual void putShorts(const short* arrayPt, RWSize count); virtual void putSignedChars(const signed char* arrayPt, RWSize count); virtual void putUnsignedChars(const unsigned char* arrayPt, RWSize count); virtual void putUnsignedInts(const unsigned int* arrayPt, RWSize count); virtual void putUnsignedLongs(const unsigned long* arrayPt, RWSize count); virtual void putUnsignedShorts(const unsigned short* arrayPt,
RWSize count); virtual void putWchar_ts(const wchar_t* arrayPt, RWSize count);
These functions write an array of values to the narrow character stream, used as the data sink.
Parameter List
arrayPt |
A pointer to the array's first element. |
count |
The number of elements to be written to the stream. |
virtual void putCharacter(char value);
Writes a narrow character to the narrow character stream that is used as the data sink.
Parameter List
value |
The narrow character to be written. |
virtual void putString(const char* string, RWSize count);
Writes a narrow character string to the narrow character stream, used as the data sink.
Parameter List
string |
A pointer to the string's first element. |
count |
The number of elements to be written to the stream. |
virtual void putUCharacter(RWUChar value);
Writes a UTF-16 character to the narrow character stream, used as the data sink.
Parameter List
value |
The UTF-16 character to be written. |
virtual void putUString(const RWUChar* ustring, RWSize count);
Writes a UTF-16 character string to the narrow character stream, used as the data sink.
Parameter List
ustring |
A pointer to the string's first element. |
count |
The number of elements to be written to the stream. |
virtual void putWCharacter(wchar_t value);
Writes a wide character to the narrow character stream, used as the data sink.
Parameter List
value |
The wide character to be written. |
virtual void putWString(const wchar_t* wstring, RWSize count);
Writes a wide character string to the narrow character stream, used as the data sink.
Parameter List
wstring |
A pointer to the string's first element. |
count |
The number of elements to be written to the stream. |
ios& getIos();
Returns a reference to the ios base class of the embedded ostream object, used to format the data inserted in this output stream object. The ios reference can then be used to modify the format flags used by the embedded ostream object when generating the formatted ascii representation of the data inserted in this output stream.
ostream& getCheckedOstream();
Returns the embedded iostreams ostream object that is used to format data. If the embedded ostream object is in a failed or bad state, an exception is thrown. Throws RWExternalStreamException.
const ostream& getCheckedOstream() const;
Returns the embedded iostreams ostream object that is used to format data. If the embedded ostream object is in a failed or bad state, an exception is thrown. Throws RWExternalStreamException.
ostream& getOstream();
Returns the embedded iostreams ostream object that is used to format data. Throws no exceptions.
const ostream& getOstream() const;
Returns the embedded iostreams ostream object that is used to format data. 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.