Module: Advanced Tools Package: Streams
RWFilteredDataInputStreamImp RWDataInputStreamImp RWInputStreamImp RWStreamImp RWBodyBase
#include <rw/stream/RWFilteredDataInputStreamImp.h>
Abstract base class for all the filtered data 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.
RWFilteredDataInputStreamImp(RWDataInputStream& sourceStream);
Used by derived classes to initialize the attached source stream.
Parameter List
sourceStream |
A handle to the attached source stream. |
virtual ~RWFilteredDataInputStreamImp();
Destructor.
virtual RWSize available() const;
Returns the number of elements that can be read from the attached source stream without blocking. The elements can be of type RWByte, char, RWUChar, or wchar_t depending on the type of the attached source stream. Throws no exceptions.
virtual void close();
Forwards the close() request to the attached source stream.
virtual void getBool(bool& value); virtual void getChar(char& value); virtual void getDouble(double& value); virtual void getFloat(float& value); virtual void getInt(int& value); virtual void getLongDouble(long double& value); virtual void getLongLong(long long& value); virtual void getLong(long& value); virtual void getShort(short& value); virtual void getSignedChar(signed char& value); virtual void getUnsignedChar(unsigned char& value); virtual void getUnsignedInt(unsigned int& value); virtual void getUnsignedLong(unsigned long& value); virtual void getUnsignedShort(unsigned short& value); virtual void getWchar_t(wchar_t& value);
These functions forward the reading of a single value from the attached source stream.
Parameter List
value |
The value to be read from the attached source stream. |
virtual RWSize getBools(bool* arrayPt, RWSize count); virtual RWSize getChars(char* arrayPt, RWSize count); virtual RWSize getDoubles(double* arrayPt, RWSize count); virtual RWSize getFloats(float* arrayPt, RWSize count); virtual RWSize getInts(int* arrayPt, RWSize count); virtual RWSize getLongs(long* arrayPt, RWSize count); virtual RWSize getLongDoubles(long double* arrayPt, RWSize count); virtual RWSize getLongLongs(long long* arrayPt, RWSize count); virtual RWSize getShorts(short* arrayPt, RWSize count); virtual RWSize getSignedChars(signed char* arrayPt, RWSize count); virtual RWSize getUnsignedChars(unsigned char* arrayPt, RWSize count); virtual RWSize getUnsignedInts(unsigned int* arrayPt, RWSize count); virtual RWSize getUnsignedLongs(unsigned long* arrayPt, RWSize count); virtual RWSize getUnsignedShorts(unsigned short* arrayPt, RWSize count); virtual RWSize getWchar_ts(wchar_t* arrayPt, RWSize count);
These functions forward the reading of an array of elements from the attached source stream. The functions return the number of elements read.
Parameter List
arrayPt |
A pointer to the first element of the array. The array must have been pre-allocated to contain at least count elements. |
count |
The number of elements to be read from the stream. |
virtual void getCharacter(char& value);
Forwards the reading of a narrow character from the attached source stream.
Parameter List
value |
The narrow character to be read from the attached source stream. |
virtual RWSize getDelimitedString(char* string, RWSize maxCount, char delim);
Forwards the reading of narrow characters from the stream until the last character read is equal to delim, or maxCount narrow characters have been read, or the end of the input sequence is reached. The narrow characters read are stored in string. The function returns the actual number of narrow characters read from the stream.
Parameter List
string |
A pointer to the string receiving the narrow characters extracted from the stream. |
maxCount |
The maximum number of narrow characters to be read. |
delim |
The narrow character used as a delimiter. |
virtual RWSize getDelimitedUString(RWUChar* ustring, RWSize maxCount,
RWUChar delim);
Forwards the reading of UTF-16 characters from the stream until the last character read is equal to delim, or maxCount UTF-16 characters have been read, or the end of the input sequence is reached. The UTF-16 characters read are stored in ustring. The function returns the actual number of UTF-16 characters read from the stream.
Parameter List
ustring |
A pointer to the string receiving the UTF-16 characters extracted from the stream. |
maxCount |
The maximum number of UTF-16 characters to be read. |
delim |
The UTF-16 character used as a delimiter. |
virtual RWSize getDelimitedWString(wchar_t* wstring, RWSize maxCount,
wchar_t delim);
Forwards the reading of wide characters from the stream until the last character read is equal to delim, or maxCount wide characters have been read, or the end of the input sequence is reached. The wide characters read are stored in wstring. The function returns the actual number of wide characters read from the stream.
Parameter List
wstring |
A pointer to the string receiving the wide characters extracted from the stream. |
maxCount |
The maximum number of wide characters to be read. |
delim |
The wide character used as a delimiter. |
virtual RWSize getString(char* string, RWSize count);
Forwards the reading of a string of narrow characters from the attached source stream. The function returns the number of narrow characters read.
Parameter List
string |
A pointer to the first element of the string. The string must have been pre-allocated to contain at least count narrow characters. |
count |
The number of narrow characters to be read from the stream. |
virtual void getUCharacter(RWUChar& value);
Forwards the reading of a UTF-16 character from the attached source stream.
Parameter List
value |
The UTF-16 character to be read from the attached source stream. |
virtual RWSize getUString(RWUChar* ustring, RWSize count);
Forwards the reading of a string of UTF-16 characters from the attached source stream. The function returns the number of UTF-16 characters read.
Parameter List
ustring |
A pointer to the first element of the string. The string must have been pre-allocated to contain at least count UTF-16 characters. |
count |
The number of UTF-16 characters to be read from the stream. |
virtual void getWCharacter(wchar_t& value);
Forwards the reading of a wide character from the attached source stream.
Parameter List
value |
The wide character to be read from the attached source stream. |
virtual RWSize getWString(wchar_t* wstring, RWSize count);
Forwards the reading of a string of wide characters from the attached source stream. The function returns the number of wide characters read.
Parameter List
wstring |
A pointer to the first element of the string. The string must have been pre-allocated to contain at least count wide characters. |
count |
The number of wide characters to be read from the 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 RWSize skip(RWSize numUnits);
Skips numUnits elements from the input sequence of the attached source stream if possible. The function returns the actual number of elements skipped, which can be any value between 0 and numUnits. The elements can be of type RWByte, char, RWUChar, or wchar_t depending on the type of the attached source stream.
Parameter List
numUnits |
The number of elements to be skipped. |
RWDataInputStream& getSourceStream(); const RWDataInputStream& 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.