Module: Advanced Tools Package: Streams
RWCharInputStream RWHandleBase
available() close() isBad() |
isEof() isFail() isGood() |
operator>>() operator=() read() |
readUntil() RWCharInputStream() skip() |
#include <rw/stream/RWCharInputStream.h>
Handle class for all the narrow character input stream implementation classes. Implements the handle idiom from the handle-body pattern.
RW_EXPLICIT RWCharInputStream(RWCharInputStreamImp* body);
Constructor.
RWCharInputStream(const RWCharInputStream& handle);
Copy constructor.
Parameter List
handle |
A narrow stream handle used to initialize the newly created handle. |
RWCharInputStream operator>>(RWCharInputStream (*pf)(RWCharInputStream&));
Extractor executing a manipulator function.
Parameter List
pf |
The manipulator's function pointer. |
RWCharInputStream& operator=(const RWCharInputStream& handle);
Assignment operator. Throws no exceptions.
Parameter List
handle |
A narrow stream handle used to initialize this handle. |
RWCharInputStream& operator>>(RWCharInputStream& (*pf)(RWCharInputStream&));
Extractor executing a manipulator function.
Parameter List
pf |
The manipulator's function pointer. |
RWCharInputStream& operator>>(char& charValue);
Reads a single narrow character from the stream.
Parameter List
charValue |
The narrow character to be read from the stream. |
RWSize available() const;
Returns the number of narrow characters that can be read from the stream without blocking.
void close();
Closes the stream.
bool isBad() const;
Returns true to indicate a loss of integrity resulting from an input, such as an irrecoverable read error from a file.
bool isEof() const;
Returns true to indicate that an input operation reached the end of an input sequence.
bool isFail() const;
Returns true to indicate that an input operation failed to read the expected data.
bool isGood() const;
Returns true to indicate a stream in a valid state.
char read();
Reads a single narrow character from the stream.
RWSize read(char* charArray, RWSize numChars);
Reads an array of narrow characters from the stream. The array must be pre-allocated to contain at list numChars elements. The function returns the actual number of narrow characters read from the stream.
Parameter List
charArray |
A pointer to the first element of the array. |
numChars |
The number of narrow characters to be read from the stream. |
void readUntil(RWCString& string, char delim= ' ');
Reads narrow characters from the stream until the last narrow character read is equal to delim, or the end of the input sequence is reached. The narrow characters read are stored in a string object.
Parameter List
string |
The string object receiving the characters extracted from the stream. |
delim |
The narrow character used as a delimiter. |
RWSize skip(RWSize numUnits);
Skips numUnits narrow characters from the input sequence if possible. The function returns the actual number of narrow characters skipped, which can be any value between 0 and numUnits.
Parameter List
numUnits |
The number of narrow characters to be skipped. |
RWCharInputStream& rwDisc(RWCharInputStream& stream);
Manipulator that discards a narrow character from a stream input sequence.
Parameter List
stream |
The narrow 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.