Module: Advanced Tools Package: Streams
RWUCharInputStream RWHandleBase
available() close() isBad() |
isEof() isFail() isGood() |
operator>>() operator=() read() |
readUntil() RWUCharInputStream() skip() |
#include <rw/stream/RWUCharInputStream.h>
Handle class for all the UTF-16 character input stream implementation classes. Implements the handle idiom from the handle-body pattern.
RW_EXPLICIT RWUCharInputStream(RWUCharInputStreamImp* body);
Constructor.
RWUCharInputStream(const RWUCharInputStream& handle);
Copy constructor.
Parameter List
handle |
A UTF-16 character stream handle used to initialize the newly created handle. |
RWUCharInputStream operator>>(RWUCharInputStream (*pf)(RWUCharInputStream&));
Extractor executing a manipulator function.
Parameter List
pf |
The manipulator's function pointer. |
RWUCharInputStream& operator=(const RWUCharInputStream& handle);
Assignment operator. Throws no exceptions.
Parameter List
handle |
A UTF-16 character stream handle used to initialize this handle. |
RWUCharInputStream& operator>>(RWUChar& unicodeValue);
Reads a single UTF-16 character from the stream.
Parameter List
unicodeValue |
The UTF-16 character to be read from the stream. |
RWUCharInputStream& operator>>(RWUCharInputStream& (*pf)(RWUCharInputStream&));
Extractor executing a manipulator function.
Parameter List
pf |
The manipulator's function pointer. |
RWSize available() const;
Returns the number of UTF-16 characters that can be read from the stream without blocking. Throws no exceptions.
void close();
Close the stream.
bool isBad() const;
Returns true to indicate a loss of integrity resulting from an input operation, such as an irrecoverable read error from a file. Throws no exceptions.
bool isEof() const;
Returns true to indicate that an input operation reached the end of an input sequence. Throws no exceptions.
bool isFail() const;
Returns true to indicate that an input operation failed to read the expected data. Throws no exceptions.
bool isGood() const;
Returns true to indicate a stream in a valid state. Throws no exceptions.
RWUChar read();
Reads a single UTF-16 character from the stream.
RWSize read(RWUChar* unicodeArray, RWSize numUChars);
Reads an array of UTF-16 characters from the stream. The array must be pre-allocated to contain at least numUChars elements. The function returns the actual number of UTF-16 characters extracted from the stream.
Parameter List
unicodeArray |
A pointer to the first element of the array. |
numUChars |
The number of UTF-16 characters to be read from the stream. |
RWSize readUntil(RWUChar* unicodeArray, RWSize maxSize,
RWUChar delim);
Reads UTF-16 characters from the 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. |
RWSize skip(RWSize numUnits);
Skips numUnits UTF-16 characters from the input sequence 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& rwDisc(RWUCharInputStream& stream);
Manipulator that discards a UTF-16 character from a stream input sequence.
Parameter List
stream |
The UTF-16 character stream. |
© 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.