SourcePro C++ 12.0 |
SourcePro® C++ API Reference Guide |
SourcePro C++ Documentation Home |
Handle class for all the data input stream implementation classes. More...
#include <rw/stream/RWDataInputStream.h>
Public Member Functions | |
RWDataInputStream (RWDataInputStreamImp *ptr) | |
RWDataInputStream (const RWDataInputStream &handle) | |
RWDataInputStream & | operator= (const RWDataInputStream &handle) |
RWDataInputStream & | operator>> (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) |
RWDataInputStream & | operator>> (bool &value) |
RWDataInputStream & | operator>> (char &value) |
RWDataInputStream & | operator>> (unsigned char &value) |
RWDataInputStream & | operator>> (signed char &value) |
RWDataInputStream & | operator>> (short &value) |
RWDataInputStream & | operator>> (unsigned short &value) |
RWDataInputStream & | operator>> (int &value) |
RWDataInputStream & | operator>> (unsigned int &value) |
RWDataInputStream & | operator>> (long &value) |
RWDataInputStream & | operator>> (unsigned long &value) |
RWDataInputStream & | operator>> (float &value) |
RWDataInputStream & | operator>> (double &value) |
RWDataInputStream & | operator>> (wchar_t &value) |
RWDataInputStream & | operator>> (long long &value) |
RWDataInputStream & | operator>> (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) |
Handle class for all the data input stream implementation classes. Implements the handle idiom from the handle-body pattern.
RWDataInputStream::RWDataInputStream | ( | RWDataInputStreamImp * | ptr | ) | [inline, explicit] |
Constructor.
RWDataInputStream::RWDataInputStream | ( | const RWDataInputStream & | handle | ) | [inline] |
Copy constructor.
handle | A data stream handle used to initialize the newly created handle. |
RWSize RWDataInputStream::available | ( | ) | const [inline] |
void RWDataInputStream::close | ( | void | ) | [inline] |
Closes the stream. May throw exceptions.
void RWDataInputStream::getBool | ( | bool & | value | ) | [inline] |
Reads a bool
value from the stream.
value | The bool to be read from the stream. |
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.
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.
value | The char to be read from the stream. |
void RWDataInputStream::getCharacter | ( | char & | value | ) | [inline] |
Reads a narrow character from the stream.
value | The narrow character to be read from the stream. |
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.
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.
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.
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.
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.
value | The double value to be read from the stream. |
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.
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.
value | The float value to be read from the stream. |
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.
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.
value | The int to be read from the stream. |
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.
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.
value | The long to be read from the stream. |
void RWDataInputStream::getLongDouble | ( | long double & | value | ) | [inline] |
Reads a long double
value from the stream.
value | The long double value to be read from the stream. |
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.
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.
value | The long long value to be read from the stream. |
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.
arrayPt | A pointer to the array's first element. | |
count | The number of element(s) to be read from the stream. |
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.
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.
value | The short to be read from the stream. |
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.
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.
value | The signed char value to be read from the stream. |
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.
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.
value | The size_t character to be read from the stream. |
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.
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.
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.
value | The unsigned char value to be read from the stream. |
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.
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.
value | The unsigned int value to be read from the stream. |
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.
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.
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.
arrayPt | A pointer to the array's first element. | |
count | The number of element(s) to be read from the stream. |
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.
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.
value | The unsigned short value to be read from the stream. |
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.
arrayPt | A pointer to the array's first element. | |
count | The number of element(s) to be read from the stream. |
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.
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.
value | The wchar_t value to be read from the stream. |
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.
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.
value | The wide character to be read from the stream. |
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
pf | The manipulator's function pointer. |
RWDataInputStream& RWDataInputStream::operator>> | ( | RWDataInputStream &(*)(RWDataInputStream &) | pf | ) | [inline] |
Extractor executing a manipulator function.
pf | The manipulator's function pointer. |
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
.
numUnits | The number of elements to be skipped. |
© 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.