Module: Advanced Tools Package: Streams
RWNativeDataFromByteInputStreamImp RWDataFromByteInputStreamImp RWDataInputStreamImp RWInputStreamImp RWStreamImp RWBodyBase
#include <rw/stream/RWNativeDataFromByteInputStreamImp.h>
The class RWNativeDataFromByteInputStreamImp reads data in native format from a binary stream. It implements the body idiom from the handle-body pattern.
RWNativeDataFromByteInputStreamImp(RWByteInputStream&
sourceStream);
Initializes the reference to the binary stream that will be used as the source of bytes.
Parameter List
sourceStream |
The binary stream that will serve as the source of bytes. |
virtual ~RWNativeDataFromByteInputStreamImp();
Destructor.
static RWDataInputStream make(RWByteInputStream& source);
Constructs an RWNativeDataFromByteInputStreamImp instance that uses source as the source of bytes, and returns a handle to it. Throws no exceptions.
Parameter List
source |
The binary stream that is used as the source of bytes. |
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 getLong(long& value); virtual void getLongDouble(long double& value); virtual void getLongLong(long 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 read a value from the stream.
Parameter List
value |
The value to be read from the 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 read an array of values from the stream. The array must have been pre-allocated to contain at least count elements. The function returns the number of elements read.
Parameter List
arrayPt |
A pointer to the array's first element. |
count |
The number of elements to be read from the stream. |
virtual void getCharacter(char& value);
Reads a narrow character from the stream.
Parameter List
value |
The narrow character to be read from the stream. |
virtual RWSize getDelimitedString(char* string, RWSize maxCount, char delim);
Reads 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);
Reads 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);
Reads 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);
Reads a narrow character string from the stream. The string must have been pre-allocated to contain at least count elements. The function returns the number of elements read.
Parameter List
string |
A pointer to the string's first element. |
count |
The number of elements to be read from the stream. |
virtual void getUCharacter(RWUChar& value);
Reads a UTF-16 character from the stream.
Parameter List
value |
The UTF-16 character to be read from the stream. |
virtual RWSize getUString(RWUChar* arrayPt, RWSize count);
Reads a UTF-16 character string from the stream. The string must have been pre-allocated to contain at least count elements. The function returns the number of elements read.
Parameter List
ustring |
A pointer to the string's first element. |
virtual void getWCharacter(wchar_t& value);
Reads a wide character from the stream.
Parameter List
value |
The wide character to be read from the stream. |
virtual RWSize getWString(wchar_t* wstring, RWSize count);
Reads a wide character string from the stream. The string must have been pre-allocated to contain at least count elements. The function returns the number of elements read.
Parameter List
wstring |
A pointer to the string's first element. |
© 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.