rwlogo
SourcePro C++ 12.0

SourcePro® C++ API Reference Guide



   SourcePro C++
Documentation Home

RWByteInputStream Class Reference
[Streams]

Handle class for all binary input stream implementation classes. More...

#include <rw/stream/RWByteInputStream.h>

Inheritance diagram for RWByteInputStream:
RWHandleBase

List of all members.

Public Member Functions

 RWByteInputStream (RWByteInputStreamImp *ptr)
 RWByteInputStream (const RWByteInputStream &handle)
RWByteInputStreamoperator= (const RWByteInputStream &handle)
RWByteInputStreamoperator>> (RWByteInputStream &(*pf)(RWByteInputStream &))
RWByteInputStream operator>> (RWByteInputStream(*pf)(RWByteInputStream &))
RWByteInputStreamoperator>> (RWByte &byteValue)
RWByte read ()
RWSize read (RWByte *byteArray, RWSize numBytes)
RWSize readUntil (RWByte *byteArray, RWSize maxSize, RWByte delim)
void close ()
bool isBad () const
bool isFail () const
bool isGood () const
bool isEof () const
RWSize available () const
RWSize skip (RWSize numUnits)

Related Functions

(Note that these are not member functions.)



RWByteInputStreamrwDisc (RWByteInputStream &stream)

Detailed Description

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


Constructor & Destructor Documentation

RWByteInputStream::RWByteInputStream ( RWByteInputStreamImp ptr  )  [inline, explicit]

Constructor.

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

Copy constructor. Throws no exceptions.

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

Member Function Documentation

RWSize RWByteInputStream::available (  )  const [inline]

Returns the number of bytes that can be read from the stream without blocking.

void RWByteInputStream::close (  )  [inline]

Closes the stream.

bool RWByteInputStream::isBad (  )  const [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.

bool RWByteInputStream::isEof (  )  const [inline]

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

bool RWByteInputStream::isFail (  )  const [inline]

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

bool RWByteInputStream::isGood (  )  const [inline]

Returns true to indicate a stream in a valid state.

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

Assignment operator. Throws no exceptions.

Parameters:
handle A binary stream handle used to initialize this handle.
RWByteInputStream& RWByteInputStream::operator>> ( RWByte byteValue  )  [inline]

Reads a single byte from the stream.

Parameters:
byteValue The byte to be read from the stream.
RWByteInputStream RWByteInputStream::operator>> ( RWByteInputStream(*)(RWByteInputStream &)  pf  )  [inline]

Extractor executing a manipulator function.

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

Extractor executing a manipulator function.

Parameters:
pf The manipulator's function pointer.
RWSize RWByteInputStream::read ( RWByte byteArray,
RWSize  numBytes 
) [inline]

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.

Parameters:
byteArray A pointer to the first element of the array.
numBytes The number of bytes to be read from the stream.
RWByte RWByteInputStream::read (  )  [inline]

Reads a single byte from the stream.

RWSize RWByteInputStream::readUntil ( RWByte byteArray,
RWSize  maxSize,
RWByte  delim 
) [inline]

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.

Parameters:
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.
RWSize RWByteInputStream::skip ( RWSize  numUnits  )  [inline]

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.

Parameters:
numUnits The number of bytes to be skipped.

Friends And Related Function Documentation

RWByteInputStream & rwDisc ( RWByteInputStream stream  )  [related]

Manipulator that discards a byte from a stream input sequence.

Parameters:
stream The binary stream.
 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.