rwlogo
SourcePro C++ 12.0

SourcePro® C++ API Reference Guide



   SourcePro C++
Documentation Home

RWCharInputStream Class Reference
[Streams]

Handle class for all narrow character input stream implementation classes. More...

#include <rw/stream/RWCharInputStream.h>

Inheritance diagram for RWCharInputStream:
RWHandleBase

List of all members.

Public Member Functions

 RWCharInputStream (RWCharInputStreamImp *ptr)
 RWCharInputStream (const RWCharInputStream &handle)
RWCharInputStreamoperator= (const RWCharInputStream &handle)
RWCharInputStreamoperator>> (RWCharInputStream &(*pf)(RWCharInputStream &))
RWCharInputStream operator>> (RWCharInputStream(*pf)(RWCharInputStream &))
RWCharInputStreamoperator>> (char &charValue)
char read ()
RWSize read (char *charArray, RWSize numChars)
void readStringUntil (RWCString &string, char delim= ' ')
RWSize readUntil (char *charArray, RWSize maxSize, char 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.)



RWCharInputStreamrwDisc (RWCharInputStream &stream)

Detailed Description

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


Constructor & Destructor Documentation

RWCharInputStream::RWCharInputStream ( RWCharInputStreamImp ptr  )  [inline, explicit]

Constructor.

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

Copy constructor.

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

Member Function Documentation

RWSize RWCharInputStream::available (  )  const [inline]

Returns the number of narrow characters that can be read from the attached source stream without blocking. Throws no exceptions.

void RWCharInputStream::close (  )  [inline]

Closes the stream.

bool RWCharInputStream::isBad (  )  const [inline]

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

bool RWCharInputStream::isEof (  )  const [inline]

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

bool RWCharInputStream::isFail (  )  const [inline]

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

bool RWCharInputStream::isGood (  )  const [inline]

Returns true to indicate a stream in a valid state.

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

Assignment operator. Throws no exceptions.

Parameters:
handle A narrow stream handle used to initialize this handle.
RWCharInputStream& RWCharInputStream::operator>> ( char &  charValue  )  [inline]

Reads a single narrow character from the stream.

Parameters:
charValue The narrow character to be read from the stream.
RWCharInputStream RWCharInputStream::operator>> ( RWCharInputStream(*)(RWCharInputStream &)  pf  )  [inline]

Extractor executing a manipulator function.

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

Extractor executing a manipulator function.

Parameters:
pf The manipulator's function pointer.
RWSize RWCharInputStream::read ( char *  charArray,
RWSize  numChars 
) [inline]

Reads an array of narrow characters from the stream. The array must be pre-allocated to contain at list numChars elements. The function returns the actual number of narrow characters read from the stream.

Parameters:
charArray A pointer to the first element of the array.
numChars The number of narrow characters to be read from the stream.
char RWCharInputStream::read (  )  [inline]

Reads a single narrow character from the stream.

void RWCharInputStream::readStringUntil ( RWCString string,
char  delim = ' ' 
) [inline]

Reads narrow character(s) from the attached source stream until the last character read is equal to delim, or the end of the input sequence is reached. The narrow character(s) read are stored in a narrow string object.

Parameters:
string A string object receiving the narrow character(s) extracted from the stream.
delim The narrow character used as a delimeter.
RWSize RWCharInputStream::readUntil ( char *  charArray,
RWSize  maxSize,
char  delim 
) [inline]

Reads narrow character(s) from the attached source stream until the last narrow character read is equal to delim, or maxSize narrow character(s) have been read, or the end of the input sequence is reached. The narrow character(s) read are stored in charArray. The function returns the actual number of narrow character(s) read from the stream.

Parameters:
charArray A pointer to the array receiving the narrow character(s) extracted from the stream.
maxSize The maximum number of narrow character(s) to be read.
delim The narrow character value used as a delimeter.
RWSize RWCharInputStream::skip ( RWSize  numUnits  )  [inline]

Skips numUnits narrow characters from the input sequence if possible. The function returns the actual number of narrow characters skipped, which can be any value between 0 and numUnits.

Parameters:
numUnits The number of narrow characters to be skipped.

Friends And Related Function Documentation

RWCharInputStream & rwDisc ( RWCharInputStream stream  )  [related]

Manipulator that discards a narrow character from a stream input sequence.

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