Handle class for all binary input stream implementation classes. More...
#include <rw/stream/RWByteInputStream.h>
Public Member Functions | |
RWByteInputStream (RWByteInputStreamImp *ptr) | |
RWByteInputStream (const RWByteInputStream &handle) | |
RWSize | available () const |
void | close () |
bool | isBad () const |
bool | isEof () const |
bool | isFail () const |
bool | isGood () const |
RWByteInputStream & | operator= (const RWByteInputStream &handle) |
RWByteInputStream & | operator>> (RWByteInputStream &(*pf)(RWByteInputStream &)) |
RWByteInputStream | operator>> (RWByteInputStream(*pf)(RWByteInputStream &)) |
RWByteInputStream & | operator>> (RWByte &byteValue) |
RWByte | read () |
RWSize | read (RWByte *byteArray, RWSize numBytes) |
RWSize | readUntil (RWByte *byteArray, RWSize maxSize, RWByte delim) |
RWSize | skip (RWSize numUnits) |
Public Member Functions inherited from RWHandleBase | |
bool | isValid (void) const |
bool | operator!= (const RWHandleBase &second) const |
bool | operator< (const RWHandleBase &second) const |
bool | operator== (const RWHandleBase &second) const |
Related Functions | |
(Note that these are not member functions.) | |
RWByteInputStream & | rwDisc (RWByteInputStream &stream) |
RWByteInputStream | rwGuard (RWByteInputStream &stream) |
Additional Inherited Members | |
Protected Member Functions inherited from RWHandleBase | |
RWHandleBase (void) | |
RWHandleBase (RWStaticCtor) | |
RWHandleBase (RWBodyBase *body) | |
RWHandleBase (const RWHandleBase &second) | |
~RWHandleBase (void) | |
RWBodyBase & | body (void) const |
RWHandleBase & | operator= (const RWHandleBase &second) |
Handle class for all the binary input stream implementation classes. Implement the handle idiom from the handle-body pattern.
|
inlineexplicit |
Constructor.
|
inline |
Copy constructor. Throws no exceptions.
handle | A binary stream handle used to initialize the newly created handle. |
|
inline |
Returns the number of bytes that can be read from the stream without blocking.
|
inline |
Closes the stream.
|
inline |
Returns true
to indicate a loss of integrity resulting from an input or output operation, such as an irrecoverable read error from a file.
|
inline |
Returns true
to indicate that an input operation reached the end of an input sequence.
|
inline |
Returns true
to indicate that an input operation failed to read the expected data.
|
inline |
Returns true
to indicate a stream in a valid state.
|
inline |
Assignment operator. Throws no exceptions.
handle | A binary stream handle used to initialize this handle. |
|
inline |
Extractor executing a manipulator function.
pf | The manipulator's function pointer. |
|
inline |
Extractor executing a manipulator function.
pf | The manipulator's function pointer. |
|
inline |
Reads a single byte from the stream.
byteValue | The byte to be read from the stream. |
|
inline |
Reads a single byte from the stream.
Reads an array of bytes from the stream. The array must be pre-allocated to contain at least numBytes elements. The function returns the actual number of bytes extracted from the stream.
byteArray | A pointer to the first element of the array. |
numBytes | The number of bytes to be read from the stream. |
Reads bytes from the stream until the last byte read is equal to delim, or maxSize bytes have been read, or the end of the input sequence is reached. The bytes read are stored in byteArray. The function returns the actual number of bytes read from the stream.
byteArray | A pointer to the array receiving the bytes extracted from the stream. |
maxSize | The maximum number of bytes to be read. |
delim | The byte value used as a delimiter. |
Skips numUnits bytes from the input sequence if possible. The function returns the actual number of bytes skipped, which can be any value between 0 and numUnits.
numUnits | The number of bytes to be skipped. |
|
related |
Manipulator that discards a byte from a stream input sequence.
stream | The binary stream. |
|
related |
Manipulator that is used to guard a series of extraction operations.
stream | A binary input stream. |
A rwGuard() manipulator creates a temporary guarded stream that locks the internal mutex of the preceding synchronized stream. In this way, any extractions following the manipulator within the statement will be atomic, that is, uninterrupted by any other threads. Note that if the preceding stream is not a synchronized stream, the rwGuard() manipulator has no effect.
Copyright © 2021 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved. |