rwlogo
SourcePro C++ 12.0

SourcePro® C++ API Reference Guide



   SourcePro C++
Documentation Home

RWDataInputStream Class Reference
[Streams]

Handle class for all the data input stream implementation classes. More...

#include <rw/stream/RWDataInputStream.h>

Inheritance diagram for RWDataInputStream:
RWHandleBase RWObjectInputStream

List of all members.

Public Member Functions

 RWDataInputStream (RWDataInputStreamImp *ptr)
 RWDataInputStream (const RWDataInputStream &handle)
RWDataInputStreamoperator= (const RWDataInputStream &handle)
RWDataInputStreamoperator>> (RWDataInputStream &(*pf)(RWDataInputStream &))
RWDataInputStream operator>> (RWDataInputStream(*pf)(RWDataInputStream &))
void close ()
bool isBad () const
bool isFail () const
bool isGood () const
bool isEof () const
RWSize available () const
RWSize skip (RWSize numUnits)
RWDataInputStreamoperator>> (bool &value)
RWDataInputStreamoperator>> (char &value)
RWDataInputStreamoperator>> (unsigned char &value)
RWDataInputStreamoperator>> (signed char &value)
RWDataInputStreamoperator>> (short &value)
RWDataInputStreamoperator>> (unsigned short &value)
RWDataInputStreamoperator>> (int &value)
RWDataInputStreamoperator>> (unsigned int &value)
RWDataInputStreamoperator>> (long &value)
RWDataInputStreamoperator>> (unsigned long &value)
RWDataInputStreamoperator>> (float &value)
RWDataInputStreamoperator>> (double &value)
RWDataInputStreamoperator>> (wchar_t &value)
RWDataInputStreamoperator>> (long long &value)
RWDataInputStreamoperator>> (long double &value)
void getBool (bool &value)
void getChar (char &value)
void getUnsignedChar (unsigned char &value)
void getSignedChar (signed char &value)
void getShort (short &value)
void getUnsignedShort (unsigned short &value)
void getInt (int &value)
void getUnsignedInt (unsigned int &value)
void getLong (long &value)
void getUnsignedLong (unsigned long &value)
void getFloat (float &value)
void getDouble (double &value)
void getWchar_t (wchar_t &value)
void getLongLong (long long &value)
void getLongDouble (long double &value)
void getCharacter (char &value)
void getWCharacter (wchar_t &value)
void getUCharacter (RWUChar &value)
void getSizeT (size_t &value)
RWSize getBools (bool *arrayPt, RWSize count)
RWSize getChars (char *arrayPt, RWSize count)
RWSize getUnsignedChars (unsigned char *arrayPt, RWSize count)
RWSize getSignedChars (signed char *arrayPt, RWSize count)
RWSize getShorts (short *arrayPt, RWSize count)
RWSize getUnsignedShorts (unsigned short *arrayPt, RWSize count)
RWSize getInts (int *arrayPt, RWSize count)
RWSize getUnsignedInts (unsigned int *arrayPt, RWSize count)
RWSize getLongs (long *arrayPt, RWSize count)
RWSize getUnsignedLongs (unsigned long *arrayPt, RWSize count)
RWSize getFloats (float *arrayPt, RWSize count)
RWSize getDoubles (double *arrayPt, RWSize count)
RWSize getWchar_ts (wchar_t *arrayPt, RWSize count)
RWSize getLongLongs (long long *arrayPt, RWSize count)
RWSize getUnsignedLongLongs (unsigned long long *arrayPt, RWSize count)
RWSize getLongDoubles (long double *arrayPt, RWSize count)
RWSize getString (char *string, RWSize count)
RWSize getWString (wchar_t *wstring, RWSize count)
RWSize getUString (RWUChar *ustring, RWSize count)
RWSize getDelimitedString (char *string, RWSize maxCount, char delim= '\0')
RWSize getDelimitedWString (wchar_t *wstring, RWSize maxCount, wchar_t delim=L'\0')
RWSize getDelimitedUString (RWUChar *ustring, RWSize maxCount, RWUChar delim)

Detailed Description

Handle class for all the data input stream implementation classes. Implements the handle idiom from the handle-body pattern.


Constructor & Destructor Documentation

RWDataInputStream::RWDataInputStream ( RWDataInputStreamImp ptr  )  [inline, explicit]

Constructor.

RWDataInputStream::RWDataInputStream ( const RWDataInputStream handle  )  [inline]

Copy constructor.

Parameters:
handle A data stream handle used to initialize the newly created handle.

Member Function Documentation

RWSize RWDataInputStream::available (  )  const [inline]

Returns the number of available elements that can be read from the stream without blocking. The type of the elements read is specified by implementation classes and can be one of the following: RWByte, char, RWUChar, or wchar_t. Throws no exceptions.

void RWDataInputStream::close ( void   )  [inline]

Closes the stream. May throw exceptions.

void RWDataInputStream::getBool ( bool &  value  )  [inline]

Reads a bool value from the stream.

Parameters:
value The bool to be read from the stream.
RWSize RWDataInputStream::getBools ( bool *  arrayPt,
RWSize  count 
) [inline]

Reads an array of bool value(s) from the stream. The array must have been pre-allocated to contain at least count elements. The function returns the number of elements read.

Parameters:
arrayPt A pointer to the array's first element.
count The number of element(s) to be read from the stream.
void RWDataInputStream::getChar ( char &  value  )  [inline]

Reads a char value from the stream.

Parameters:
value The char to be read from the stream.
void RWDataInputStream::getCharacter ( char &  value  )  [inline]

Reads a narrow character from the stream.

Parameters:
value The narrow character to be read from the stream.
RWSize RWDataInputStream::getChars ( char *  arrayPt,
RWSize  count 
) [inline]

Reads an array of char value(s) from the stream. The array must have been pre-allocated to contain at least count elements. The function returns the number of elements read.

Parameters:
arrayPt A pointer to the array's first element.
count The number of element(s) to be read from the stream.
RWSize RWDataInputStream::getDelimitedString ( char *  string,
RWSize  maxCount,
char  delim = '\0' 
) [inline]

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.

Parameters:
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.
RWSize RWDataInputStream::getDelimitedUString ( RWUChar ustring,
RWSize  maxCount,
RWUChar  delim 
) [inline]

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.

Parameters:
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.
RWSize RWDataInputStream::getDelimitedWString ( wchar_t *  wstring,
RWSize  maxCount,
wchar_t  delim = L'\0' 
) [inline]

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 wstring stores the wide characters read. The function returns the actual number of wide characters read from the stream.

Parameters:
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.
void RWDataInputStream::getDouble ( double &  value  )  [inline]

Reads a double value from the stream.

Parameters:
value The double value to be read from the stream.
RWSize RWDataInputStream::getDoubles ( double *  arrayPt,
RWSize  count 
) [inline]

Reads an array of double value(s) from the stream. The array must have been pre-allocated to contain at least count elements. The function returns the number of elements read.

Parameters:
arrayPt A pointer to the array's first element.
count The number of element(s) to be read from the stream.
void RWDataInputStream::getFloat ( float &  value  )  [inline]

Reads a float value from the stream.

Parameters:
value The float value to be read from the stream.
RWSize RWDataInputStream::getFloats ( float *  arrayPt,
RWSize  count 
) [inline]

Reads an array of float value(s) from the stream. The array must have been pre-allocated to contain at least count elements. The function returns the number of elements read.

Parameters:
arrayPt A pointer to the array's first element.
count The number of element(s) to be read from the stream.
void RWDataInputStream::getInt ( int &  value  )  [inline]

Reads a int value from the stream.

Parameters:
value The int to be read from the stream.
RWSize RWDataInputStream::getInts ( int *  arrayPt,
RWSize  count 
) [inline]

Reads an array of int value(s) from the stream. The array must have been pre-allocated to contain at least count elements. The function returns the number of elements read.

Parameters:
arrayPt A pointer to the array's first element.
count The number of element(s) to be read from the stream.
void RWDataInputStream::getLong ( long &  value  )  [inline]

Reads a long value from the stream.

Parameters:
value The long to be read from the stream.
void RWDataInputStream::getLongDouble ( long double &  value  )  [inline]

Reads a long double value from the stream.

Parameters:
value The long double value to be read from the stream.
RWSize RWDataInputStream::getLongDoubles ( long double *  arrayPt,
RWSize  count 
) [inline]

Reads an array of long double value(s) from the stream. The array must have been pre-allocated to contain at least count elements. The function returns the number of elements read.

Parameters:
arrayPt A pointer to the array's first element.
count The number of element(s) to be read from the stream.
void RWDataInputStream::getLongLong ( long long &  value  )  [inline]

Reads a long long value from the stream.

Parameters:
value The long long value to be read from the stream.
RWSize RWDataInputStream::getLongLongs ( long long *  arrayPt,
RWSize  count 
) [inline]

Reads an array of long long value(s) from the stream. The array must have been pre-allocated to contain at least count elements. The function returns the number of elements read.

Parameters:
arrayPt A pointer to the array's first element.
count The number of element(s) to be read from the stream.
RWSize RWDataInputStream::getLongs ( long *  arrayPt,
RWSize  count 
) [inline]

Reads an array of long value(s) from the stream. The array must have been pre-allocated to contain at least count elements. The function returns the number of elements read.

Parameters:
arrayPt A pointer to the array's first element.
count The number of element(s) to be read from the stream.
void RWDataInputStream::getShort ( short &  value  )  [inline]

Reads a short value from the stream.

Parameters:
value The short to be read from the stream.
RWSize RWDataInputStream::getShorts ( short *  arrayPt,
RWSize  count 
) [inline]

Reads an array of short value(s) from the stream. The array must have been pre-allocated to contain at least count elements. The function returns the number of elements read.

Parameters:
arrayPt A pointer to the array's first element.
count The number of element(s) to be read from the stream.
void RWDataInputStream::getSignedChar ( signed char &  value  )  [inline]

Reads a signed char value from the stream.

Parameters:
value The signed char value to be read from the stream.
RWSize RWDataInputStream::getSignedChars ( signed char *  arrayPt,
RWSize  count 
) [inline]

Reads an array of signed char value(s) from the stream. The array must have been pre-allocated to contain at least count elements. The function returns the number of elements read.

Parameters:
arrayPt A pointer to the array's first element.
count The number of element(s) to be read from the stream.
void RWDataInputStream::getSizeT ( size_t &  value  )  [inline]

Reads a size_t character from the stream.

Parameters:
value The size_t character to be read from the stream.
RWSize RWDataInputStream::getString ( char *  string,
RWSize  count 
) [inline]

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.

Parameters:
string A pointer to the string's first element.
count The number of elements to be read from the stream.
void RWDataInputStream::getUCharacter ( RWUChar value  )  [inline]

Reads a UTF-16 character from the stream.

Parameters:
value The UTF-16 character to be read from the stream.
void RWDataInputStream::getUnsignedChar ( unsigned char &  value  )  [inline]

Reads a unsigned char value from the stream.

Parameters:
value The unsigned char value to be read from the stream.
RWSize RWDataInputStream::getUnsignedChars ( unsigned char *  arrayPt,
RWSize  count 
) [inline]

Reads an array of unsigned char value(s) from the stream. The array must have been pre-allocated to contain at least count elements. The function returns the number of elements read.

Parameters:
arrayPt A pointer to the array's first element.
count The number of element(s) to be read from the stream.
void RWDataInputStream::getUnsignedInt ( unsigned int &  value  )  [inline]

Reads a unsigned int value from the stream.

Parameters:
value The unsigned int value to be read from the stream.
RWSize RWDataInputStream::getUnsignedInts ( unsigned int *  arrayPt,
RWSize  count 
) [inline]

Reads an array of unsigned int value(s) from the stream. The array must have been pre-allocated to contain at least count elements. The function returns the number of elements read.

Parameters:
arrayPt A pointer to the array's first element.
count The number of element(s) to be read from the stream.
void RWDataInputStream::getUnsignedLong ( unsigned long &  value  )  [inline]

Reads a unsigned long value from the stream.

Parameters:
value The unsigned long value to be read from the stream.
RWSize RWDataInputStream::getUnsignedLongLongs ( unsigned long long *  arrayPt,
RWSize  count 
) [inline]

Reads an array of unsigned long long value(s) from the stream. The array must have been pre-allocated to contain at least count elements. The function returns the number of elements read.

Parameters:
arrayPt A pointer to the array's first element.
count The number of element(s) to be read from the stream.
RWSize RWDataInputStream::getUnsignedLongs ( unsigned long *  arrayPt,
RWSize  count 
) [inline]

Reads an array of unsigned long value(s) from the stream. The array must have been pre-allocated to contain at least count elements. The function returns the number of elements read.

Parameters:
arrayPt A pointer to the array's first element.
count The number of element(s) to be read from the stream.
void RWDataInputStream::getUnsignedShort ( unsigned short &  value  )  [inline]

Reads a unsigned short value from the stream.

Parameters:
value The unsigned short value to be read from the stream.
RWSize RWDataInputStream::getUnsignedShorts ( unsigned short *  arrayPt,
RWSize  count 
) [inline]

Reads an array of unsigned short value(s) from the stream. The array must have been pre-allocated to contain at least count elements. The function returns the number of elements read.

Parameters:
arrayPt A pointer to the array's first element.
count The number of element(s) to be read from the stream.
RWSize RWDataInputStream::getUString ( RWUChar ustring,
RWSize  count 
) [inline]

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.

Parameters:
ustring A pointer to the string's first element.
count The number of elements to be read from the stream.
void RWDataInputStream::getWchar_t ( wchar_t &  value  )  [inline]

Reads a wchar_t value from the stream.

Parameters:
value The wchar_t value to be read from the stream.
RWSize RWDataInputStream::getWchar_ts ( wchar_t *  arrayPt,
RWSize  count 
) [inline]

Reads an array of wchar_t value(s) from the stream. The array must have been pre-allocated to contain at least count elements. The function returns the number of elements read.

Parameters:
arrayPt A pointer to the array's first element.
count The number of element(s) to be read from the stream.
void RWDataInputStream::getWCharacter ( wchar_t &  value  )  [inline]

Reads a wide character from the stream.

Parameters:
value The wide character to be read from the stream.
RWSize RWDataInputStream::getWString ( wchar_t *  wstring,
RWSize  count 
) [inline]

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.

Parameters:
wstring A pointer to the string's first element.
count The number of elements to be read from the stream.
bool RWDataInputStream::isBad (  )  const [inline]

Returns true to indicate a loss of integrity resulting from an input, such as an irrecoverable read error from a file. Throws no exceptions.

bool RWDataInputStream::isEof (  )  const [inline]

Returns true to indicate that an input operation reached the end of an input sequence. Throws no exceptions.

bool RWDataInputStream::isFail (  )  const [inline]

Returns true to indicate that an input operation failed to read the expected data. Throws no exceptions.

bool RWDataInputStream::isGood (  )  const [inline]

Returns true to indicate a stream in a valid state. Throws no exceptions.

RWDataInputStream& RWDataInputStream::operator= ( const RWDataInputStream handle  )  [inline]

Assignment operator. Throws no exceptions.

Parameters:
handle A data stream handle used to initialize this handle.
RWDataInputStream& RWDataInputStream::operator>> ( long double &  value  )  [inline]

Reads a long double value from the stream.

Parameters:
value The long double value to be read from the stream.

Reimplemented in RWObjectInputStream.

RWDataInputStream& RWDataInputStream::operator>> ( long long &  value  )  [inline]

Reads a long long value from the stream.

Parameters:
value The long long value to be read from the stream.

Reimplemented in RWObjectInputStream.

RWDataInputStream& RWDataInputStream::operator>> ( wchar_t &  value  )  [inline]

Reads a wchar_t value from the stream.

Parameters:
value The wchar_t value to be read from the stream.

Reimplemented in RWObjectInputStream.

RWDataInputStream& RWDataInputStream::operator>> ( double &  value  )  [inline]

Reads a double value from the stream.

Parameters:
value The double value to be read from the stream.

Reimplemented in RWObjectInputStream.

RWDataInputStream& RWDataInputStream::operator>> ( float &  value  )  [inline]

Reads a float value from the stream.

Parameters:
value The float value to be read from the stream.

Reimplemented in RWObjectInputStream.

RWDataInputStream& RWDataInputStream::operator>> ( unsigned long &  value  )  [inline]

Reads a unsigned long value from the stream.

Parameters:
value The unsigned long value to be read from the stream.

Reimplemented in RWObjectInputStream.

RWDataInputStream& RWDataInputStream::operator>> ( long &  value  )  [inline]

Reads a long value from the stream.

Parameters:
value The long value to be read from the stream.

Reimplemented in RWObjectInputStream.

RWDataInputStream& RWDataInputStream::operator>> ( unsigned int &  value  )  [inline]

Reads a unsigned int value from the stream.

Parameters:
value The unsigned int value to be read from the stream.

Reimplemented in RWObjectInputStream.

RWDataInputStream& RWDataInputStream::operator>> ( int &  value  )  [inline]

Reads a int value from the stream.

Parameters:
value The int value to be read from the stream.

Reimplemented in RWObjectInputStream.

RWDataInputStream& RWDataInputStream::operator>> ( unsigned short &  value  )  [inline]

Reads a unsigned short value from the stream.

Parameters:
value The unsigned short value to be read from the stream.

Reimplemented in RWObjectInputStream.

RWDataInputStream& RWDataInputStream::operator>> ( short &  value  )  [inline]

Reads a short value from the stream.

Parameters:
value The short value to be read from the stream.

Reimplemented in RWObjectInputStream.

RWDataInputStream& RWDataInputStream::operator>> ( signed char &  value  )  [inline]

Reads a signed char value from the stream.

Parameters:
value The signed char value to be read from the stream.

Reimplemented in RWObjectInputStream.

RWDataInputStream& RWDataInputStream::operator>> ( unsigned char &  value  )  [inline]

Reads a unsigned char value from the stream.

Parameters:
value The unsigned char value to be read from the stream.

Reimplemented in RWObjectInputStream.

RWDataInputStream& RWDataInputStream::operator>> ( char &  value  )  [inline]

Reads a char value from the stream.

Parameters:
value The char value to be read from the stream.

Reimplemented in RWObjectInputStream.

RWDataInputStream& RWDataInputStream::operator>> ( bool &  value  )  [inline]

Reads a char value from the stream.

Parameters:
value The bool value to be read from the stream.

Reimplemented in RWObjectInputStream.

RWDataInputStream RWDataInputStream::operator>> ( RWDataInputStream(*)(RWDataInputStream &)  pf  )  [inline]

Extractor executing a manipulator function.

Parameters:
pf The manipulator's function pointer.
RWDataInputStream& RWDataInputStream::operator>> ( RWDataInputStream &(*)(RWDataInputStream &)  pf  )  [inline]

Extractor executing a manipulator function.

Parameters:
pf The manipulator's function pointer.
RWSize RWDataInputStream::skip ( RWSize  numUnits  )  [inline]

Skips numUnits elements from the input sequence if possible. The function returns the actual number of elements skipped, which can be any value between 0 and numUnits. The type of the elements skipped is specified by implementation classes and can be one of the following: RWByte, char, RWUChar, or wchar_t.

Parameters:
numUnits The number of elements to be skipped.
 All Classes Functions Variables Typedefs Enumerations Enumerator Friends

© 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.