Module: Advanced Tools Package: Streams
RWTStreambufToByteCharOutputStream std::streambuf
#include <rw/stream/RWTStreambufToByteCharOutputStream.h>
The class RWTStreambufToByteCharOutputStream is an adaptor class that adapts the iostreams std::streambuf interface to the Rogue Wave binary and narrow character Output Stream interfaces. Requests made through the iostreams streambuf interface are forwarded to the embedded output stream handle. Calls to the iostreams streambuf functions dealing with the streambuf's input sequence will always fail since the underlying output stream only supports output operations. The type of the underlying output stream is provided by the template parameter OutputStream, and can be RWByteOutputStream or RWCharOutputStream.
typedef OutputStream RWOutputStream_type RWOutputStream_type typedef typename OutputStream::element_type element_type
RWTStreambufToByteCharOutputStream(OutputStream& sinkStream);
Initializes the reference to the output stream that will be used as the sink of elements.
Parameter List
sinkStream |
The output stream that will serve as the sink of elements. |
virtual ~RWTStreambufToByteCharOutputStream();
Destructor.
OutputStream& getSinkStream();
Returns a handle to the embedded Output Stream that is used as the sink of elements. Throws no exceptions.
const OutputStream& getSinkStream() const;
Returns a handle to the embedded Output Stream that is used as the sink of elements. Throws no exceptions.
virtual int_type overflow(int_type c = traits_type::eof());
(Use if a standard C++ library implementation and the Standard iostreams are defined.)
virtual int overflow(int c=EOF);
(Use if the Standard iostreams are not defined.)
Consumes the bytes in the put area, by inserting them in the embedded output stream. If c is not EOF, it is either consumed or placed in the newly established put area. This function is normally called when the put area is full, but may be called at other times to force the consumption of the bytes in the put area. If an error occurs, overflow() returns EOF, otherwise it returns a value other than EOF. Throws no exceptions.
Parameter List
c |
EOF to force consumption of the bytes in the put area, or any other 8 bits value that need to be inserted in the put area. |
virtual int_type pbackfail(int_type c = traits::eof());
(Use if a standard C++ library implementation and the Standard iostreams are defined.)
virtual int pbackfail(int c= EOF);
(Use if the Standard iostreams are not defined.)
This function always returns EOF to indicate failure. Throws no exceptions.
virtual pos_type seekoff(off_type off, ios_base::seekdir way, ios_base::openmode which = ios_base::in | ios_base::out);
(Use if a standard C++ library implementation and the Standard iostreams are defined.)
virtual streampos seekoff(streamoff offset, ios::seek_dir dir, int mode= ios::in | ios::out);
(Use if the Standard iostreams are not defined.)
This function always returns EOF to indicate failure. Throws no exceptions.
virtual pos_type seekpos(pos_type sp,ios_base)::openmode which = ios_base)::in
| ios_base::out);
(Use if a standard C++ library implementation and the Standard iostreams are defined.)
virtual streampos seekpos(streampos, int mode= ios::in | ios::out);
(Use if the Standard iostreams are not defined.)
This function always returns EOF to indicate failure. Throws no exceptions.
virtual int sync();
This function synchronizes the controlled output sequence with the array. That is, if pbase() is non-null the characters between pbase() and pptr() are written to the controlled output sequence. The pointers may then be reset as appropriate. The function returns EOF in case of error; otherwise it returns zero. Throws no exceptions.
virtual int_type underflow();
(Use if a standard C++ library implementation and the Standard iostreams are defined.)
virtual int underflow();
(Use if the Standard iostreams are not defined.)
This function always returns EOF to indicate failure. Throws no exceptions.
virtual streamsize xsgetn(char_type*, streamsize);
(Use if a standard C++ library implementation and the Standard iostreams are defined.)
virtual int xsgetn(char*, int);
(Use if the Standard iostreams are not defined.)
This function always returns EOF to indicate failure. Throws no exceptions.
virtual streamsize xsputn(const char_type* s, streamsize n);
(Use if a standard C++ library implementation and the Standard iostreams are defined.)
virtual int xsputn(const char* s, int n);
(Use if the Standard iostreams are not defined.)
This function stores n characters (bytes) pointed to by s after the put pointer, and increments the put pointer by n. If the function rwUnbuffered() returns true, then the characters (bytes) are directly forwarded to the embedded output stream. Throws no exceptions.
Parameter List
s |
A pointer to the first element of the character (byte) array. |
n |
The number of elements to be written. |
© 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.