Module: Advanced Tools Package: Streams
RWWCharFromWStreambufInputStreamImp RWWCharInputStreamImp RWInputStreamImp RWStreamImp RWBodyBase
available() close() getSourceBuff() isBad() |
isEof() isFail() isGood() make() |
read() readUntil() RWWCharFromWStreambufInputStreamImp() skip() |
~RWWCharFromWStreambufInputStreamImp() |
#include <rw/stream/RWWCharFromWStreambufInputStreamImp.h>
Concrete class connecting a wide character stream to an iostreams wide character buffer. The iostreams buffer is used as source for the wide characters read from the wide character stream. Implements the body idiom from the handle-body pattern.
NOTE -- This class is available only when you build the Streams package using the Standard C++ iostreams library.
RWWCharFromWStreambufInputStreamImp(wstreambuf& sourceBuff);
Initializes the reference to the iostreams wstreambuf, that will be used as the source of wide characters.
Parameter List
sourceBuff |
The iostreams wstreambuf that will serve as the source of wide characters. |
virtual ~RWWCharFromWStreambufInputStreamImp();
Destructor.
static RWWCharInputStream make(wstreambuf& source);
Constructs an RWWCharFromWStreambufInputStreamImp instance that uses source as its source of wide characters, and returns a handle to it. Throws no exceptions.
Parameter List
source |
The iostreams wstreambuf that is used as the source of wide characters. |
virtual RWSize available() const;
Returns the number of wide characters that can be read from the iostreams wstreambuf used as the source of wide character without blocking.
virtual void close();
This function does nothing. The user is responsible for closing the iostreams wstreambuf used as the source of wide characters if necessary. Throws no exceptions.
virtual bool isBad() const;
Returns true if the last operation performed on the iostreams wstreambuf failed. Throws no exceptions.
virtual bool isEof() const;
Returns true if there is no wide characters available from the iostreams wstreambuf used as the source of wide characters. Throws no exceptions.
virtual bool isFail() const;
Returns true if the last operation performed on the iostreams wstreambuf failed. Throws no exceptions.
virtual bool isGood() const;
Returns true if the last operation performed on the iostreams wstreambuf succeeded. Throws no exceptions.
virtual wchar_t read();
Reads a single wide character from the iostreams wstreambuf used as the source of wide characters.
virtual RWSize read(wchar_t* wcharArray, RWSize numWChars);
Reads an array of wide characters(s) from the iostreams wstreambuf used as the source of wide characters. The array must be pre-allocated to contain at least numWChars elements. The function returns the actual number of wide characters extracted from the iostreams wstreambuf.
Parameter List
wcharArray |
A pointer to the first element of the array. |
numWChars |
The number of wide characters to be read from the stream. |
virtual RWSize readUntil(wchar_t* wcharArray, RWSize maxSize, wchar_t delim);
Reads wide characters from the iostreams wstreambuf used as the source of wide characters until the last wide character read is equal to delim, or maxSize wide characters have been read, or the end of the input sequence is reached. The wide characters read are stored in wcharArray. The function returns the actual number of wide characters inserted into wcharArray. If the last wide character extracted is equal to delim, then it is not stored in wcharArray.
Parameter List
wcharArray |
A pointer to the array receiving the wide characters extracted from the iostreams wstreambuf. |
maxSize |
The maximum number of wide characters to be read. |
delim |
The wide character used as a delimiter. |
virtual RWSize skip(RWSize numUnits);
Skips numUnits wide characters from the input sequence if possible. The function returns the actual number of wide characters skipped, which can be any value between 0 and numUnits.
Parameter List
numUnits |
The number of wide characters to be skipped. |
wstreambuf& getSourceBuff(); const wstreambuf& getSourceBuff() const;
These functions return a reference to the iostreams wstreambuf, which is used as the source of wide characters. 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.