Module: Advanced Tools Package: Streams
RWFilteredUCharInputStreamImp RWUCharInputStreamImp RWInputStreamImp RWStreamImp RWBodyBase
available() close() getSourceStream() |
isBad() isEof() isFail() |
isGood() read() readUntil() |
RWFilteredUCharInputStreamImp() skip() ~RWFilteredUCharInputStreamImp() |
#include <rw/stream/RWFilteredUCharInputStreamImp.h>
Abstract base class for all the filtered UTF-16 character input stream implementation classes. A filtered input stream is a stream that uses its attached input stream as the source of elements to its own functions. Implements the body idiom from the handle-body pattern.
RWFilteredUCharInputStreamImp(RWUCharInputStream&
sourceStream);
Used by derived classes to initialize the attached source stream.
Parameter List
sourceStream |
A handle to the attached source stream. |
virtual ~RWFilteredUCharInputStreamImp();
Destructor.
virtual RWSize available() const;
Returns the number of UTF-16 characters that can be read from the attached source stream without blocking. Throws no exceptions.
virtual void close();
Forwards the close() request to the attached source stream.
virtual bool isBad() const;
Forwards the isBad() request to the attached source stream. Throws no exceptions.
virtual bool isEof() const;
Forwards the isEof() request to the attached source stream. Throws no exceptions.
virtual bool isFail() const;
Forwards the isFail() request to the attached source stream. Throws no exceptions.
virtual bool isGood() const;
Forwards the isGood() request to the attached source stream. Throws no exceptions.
virtual RWUChar read();
Forwards the reading of a single UTF-16 character from the attached source stream.
virtual RWSize read(RWUChar* unicodeArray, RWSize numUChars);
Forwards the reading of an array of UTF-16 characters from the attached source stream. The function returns the actual number of UTF-16 characters read.
Parameter List
unicodeArray |
A pointer to the first element of the array. The array must have been pre-allocated to contain at least numUChars elements. |
numUChars |
The number of UTF-16 characters to be read from the stream. |
virtual RWSize readUntil(RWUChar* unicodeArray, RWSize maxSize,
RWUChar delim);
Reads UTF-16 characters from the attached source stream until the last UTF-16 character read is equal to delim, or maxSize UTF-16 characters have been read, or the end of the input sequence is reached. The UTF-16 characters read are stored in unicodeArray. The function returns the actual number of UTF-16 characters read from the stream.
Parameter List
unicodeArray |
A pointer to the array receiving the UTF-16 characters extracted from the stream. |
maxSize |
The maximum number of UTF-16 characters to be read. |
delim |
The UTF-16 character used as a delimiter. |
virtual RWSize skip(RWSize numUnits);
Skips numUnits UTF-16 characters from the input sequence of the attached source stream if possible. The function returns the actual number of UTF-16 characters skipped, which can be any value between 0 and numUnits.
Parameter List
numUnits |
The number of UTF-16 characters to be skipped. |
RWUCharInputStream& getSourceStream(); const RWUCharInputStream& getSourceStream() const;
These functions return a handle to the attached source stream. They throw 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.