SourcePro® 2024.1 |
SourcePro® API Reference Guide |
Concrete class that connects a binary stream to an iostreams narrow character buffer. More...
#include <rw/stream/RWByteFromStreambufInputStreamImp.h>
Public Member Functions | |
virtual | ~RWByteFromStreambufInputStreamImp () |
virtual RWSize | available () const |
virtual void | close () |
virtual bool | isBad () const |
virtual bool | isEof () const |
virtual bool | isFail () const |
virtual bool | isGood () const |
virtual RWByte | read () |
virtual RWSize | read (RWByte *byteArray, RWSize numBytes) |
virtual RWSize | readUntil (RWByte *byteArray, RWSize maxSize, RWByte delim) |
virtual RWSize | skip (RWSize numUnits) |
Public Member Functions inherited from RWByteInputStreamImp | |
virtual | ~RWByteInputStreamImp () |
virtual RWByteInputStream | acquire () |
virtual void | release () |
Public Member Functions inherited from RWInputStreamImp | |
virtual | ~RWInputStreamImp () |
Public Member Functions inherited from RWStreamImp | |
virtual | ~RWStreamImp () |
Static Public Member Functions | |
static RWByteInputStream | make (std::streambuf &source) |
Protected Member Functions | |
RWByteFromStreambufInputStreamImp (std::streambuf &sourceBuff) | |
std::streambuf & | getSourceBuff () |
const std::streambuf & | getSourceBuff () const |
Protected Member Functions inherited from RWByteInputStreamImp | |
RWByteInputStreamImp () | |
Protected Member Functions inherited from RWInputStreamImp | |
RWInputStreamImp () | |
Protected Member Functions inherited from RWStreamImp | |
RWStreamImp () | |
Protected Member Functions inherited from RWBodyBase | |
RWBodyBase (const RWBodyBase &second) | |
RWBodyBase (RWStaticCtor) | |
RWBodyBase (void) | |
virtual | ~RWBodyBase (void) |
RWBodyBase & | operator= (const RWBodyBase &second) |
Protected Member Functions inherited from RWTCountingBody< RWMutexLock > | |
RWTCountingBody (const RWTCountingBody< RWMutexLock > &second) | |
RWTCountingBody (RWStaticCtor) | |
RWTCountingBody (unsigned initCount=0) | |
RWTCountingBody< RWMutexLock > & | operator= (const RWTCountingBody< RWMutexLock > &second) |
~RWTCountingBody (void) | |
unsigned | addReference (void) |
unsigned | references (void) const |
unsigned | removeReference (void) |
Protected Member Functions inherited from RWTMonitor< RWMutexLock > | |
RWTMonitor (const RWTMonitor< RWMutexLock > &second) | |
RWTMonitor (RWStaticCtor) | |
RWTMonitor (void) | |
~RWTMonitor (void) | |
void | acquire (void) |
bool | isAcquired (void) const |
RWTMonitor< RWMutexLock > & | monitor (void) const |
RWMutexLock & | mutex (void) |
RWTMonitor< RWMutexLock > & | operator= (const RWTMonitor< RWMutexLock > &) |
void | release (void) |
bool | tryAcquire (void) |
Additional Inherited Members | |
Protected Types inherited from RWTCountingBody< RWMutexLock > | |
typedef RWTLockGuard< RWTMonitor< RWMutexLock > > | LockGuard |
typedef RWTTryLockGuard< RWTMonitor< RWMutexLock > > | TryLockGuard |
typedef RWTUnlockGuard< RWTMonitor< RWMutexLock > > | UnlockGuard |
Protected Types inherited from RWTMonitor< RWMutexLock > | |
typedef RWTLockGuard< RWTMonitor< RWMutexLock > > | LockGuard |
typedef RWTTryLockGuard< RWTMonitor< RWMutexLock > > | TryLockGuard |
typedef RWTUnlockGuard< RWTMonitor< RWMutexLock > > | UnlockGuard |
Concrete class connecting a binary stream to an iostreams narrow character buffer. The iostreams buffer is used as the source for the data read from the binary stream. The iostreams buffer must be opened in binary mode. Implements the body idiom from the handle-body pattern.
|
virtual |
Destructor.
|
inlineprotected |
Initializes the reference to the iostreams std::streambuf
, that will be used as the source of bytes. Throws no exceptions.
sourceBuff | The iostreams std::streambuf that will serve as the source of bytes. |
|
virtual |
Returns the number of bytes that can be read from the iostreams std::streambuf
(used as the source of bytes), without blocking.
Implements RWInputStreamImp.
|
virtual |
This function does nothing. The user is responsible for closing the iostreams std::streambuf
, used as the source of bytes, if necessary.
Implements RWStreamImp.
|
inlineprotected |
Returns a reference to the iostreams std::streambuf
, which is used as the source of bytes.
|
inlineprotected |
Returns a const reference to the iostreams std::streambuf
, which is used as the source of bytes.
|
virtual |
Returns true
if the last operation performed on the iostreams std::streambuf
failed.
Implements RWStreamImp.
|
virtual |
Returns true
if there is no bytes available from the iostreams std::streambuf
, used as the source of bytes.
Implements RWInputStreamImp.
|
virtual |
Returns true
if the last operation performed on the iostreams std::streambuf
failed.
Implements RWStreamImp.
|
virtual |
Returns true
if the last operation performed on the iostreams std::streambuf
succeeded.
Implements RWStreamImp.
|
inlinestatic |
Constructs an RWByteFromStreambufInputStreamImp instance that uses source as the source of bytes, and returns a handle to it. Throws no exceptions.
source | The iostreams std::streambuf that is used as the source of bytes. |
|
virtual |
Reads a single byte from the iostreams std::streambuf
, used as the source of bytes.
RWExternalStreamException | Thrown when the call to the internal iostreams std::streambuf object fails or any propagated exceptions from that call occur. |
Implements RWByteInputStreamImp.
|
virtual |
Reads an array of bytes from the iostreams std::streambuf
, used as the source of bytes. The array must be pre-allocated to contain at least numBytes elements. The function returns the actual number of bytes extracted from the iostreams std::streambuf
.
RWExternalStreamException | Thrown when the call to the internal iostreams std::streambuf object fails or any propagated exceptions from that call occur. |
byteArray | Pointer to the first element of the array. |
numBytes | Number of bytes to be read from the stream. |
Implements RWByteInputStreamImp.
|
virtual |
Reads bytes from the iostreams std::streambuf
, used as the source of bytes, 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 inserted into byteArray. If the last byte extracted is equal to delim, then it is not stored in byteArray.
byteArray | Pointer to the array receiving the bytes extracted from the iostreams std::streambuf . |
maxSize | Maximum number of bytes to be read. |
delim | Byte value used as a delimiter. |
Implements RWByteInputStreamImp.
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. |
Implements RWInputStreamImp.
Copyright © 2024 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved. |