SourcePro® API Reference Guide

 
List of all members | Public Member Functions | Protected Member Functions
RWCharInputStreamImp Class Referenceabstract

Abstract base class for all narrow character input stream implementation classes. More...

#include <rw/stream/RWCharInputStreamImp.h>

Inheritance diagram for RWCharInputStreamImp:
RWInputStreamImp RWStreamImp RWBodyBase RWTCountingBody< RWMutexLock > RWTMonitor< RWMutexLock > RWCharFromStreambufInputStreamImp RWFilteredCharInputStreamImp RWTInputStreamBufferImp< RWCharInputStream, RWFilteredCharInputStreamImp > RWTInputStreamLockImp< RWCharInputStream, RWFilteredCharInputStreamImp > RWBufferedCharInputStreamImp RWSynchronizedCharInputStreamImp

Public Member Functions

virtual ~RWCharInputStreamImp ()
 
virtual RWCharInputStream acquire ()
 
virtual char read ()=0
 
virtual RWSize read (char *charArray, RWSize numChars)=0
 
virtual void readStringUntil (RWCString &string, char delim)=0
 
virtual RWSize readUntil (char *charArray, RWSize maxSize, char delim)=0
 
virtual void release ()
 
- Public Member Functions inherited from RWInputStreamImp
virtual ~RWInputStreamImp ()
 
virtual RWSize available () const =0
 
virtual bool isEof () const =0
 
virtual RWSize skip (RWSize numUnits)=0
 
- Public Member Functions inherited from RWStreamImp
virtual ~RWStreamImp ()
 
virtual void close ()=0
 
virtual bool isBad () const =0
 
virtual bool isFail () const =0
 
virtual bool isGood () const =0
 

Protected Member Functions

 RWCharInputStreamImp ()
 
- Protected Member Functions inherited from RWInputStreamImp
 RWInputStreamImp ()
 
- Protected Member Functions inherited from RWStreamImp
 RWStreamImp ()
 
- Protected Member Functions inherited from RWBodyBase
 RWBodyBase (void)
 
 RWBodyBase (RWStaticCtor)
 
 RWBodyBase (const RWBodyBase &second)
 
virtual ~RWBodyBase (void)
 
RWBodyBaseoperator= (const RWBodyBase &second)
 
- Protected Member Functions inherited from RWTCountingBody< RWMutexLock >
 RWTCountingBody (unsigned initCount=0)
 
 RWTCountingBody (RWStaticCtor)
 
 RWTCountingBody (const RWTCountingBody< RWMutexLock > &second)
 
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 ()
 
 RWTMonitor (RWStaticCtor)
 
 RWTMonitor (const RWTMonitor< RWMutexLock > &second)
 
 ~RWTMonitor ()
 
void acquire ()
 
bool isAcquired () const
 
RWTMonitor< RWMutexLock > & monitor () const
 
RWMutexLockmutex ()
 
RWTMonitor< RWMutexLock > & operator= (const RWTMonitor< RWMutexLock > &)
 
void release ()
 
bool tryAcquire ()
 

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
 

Detailed Description

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

Constructor & Destructor Documentation

virtual RWCharInputStreamImp::~RWCharInputStreamImp ( )
inlinevirtual

Destructor.

RWCharInputStreamImp::RWCharInputStreamImp ( )
inlineprotected

Constructor.

Member Function Documentation

virtual RWCharInputStream RWCharInputStreamImp::acquire ( )
virtual

Acquires the synchronization mechanism provided by a stream concrete implementation. The acquire() member function returns a handle to the narrow character stream that should be used for input operation after acquiring the synchronization mechanism.

Reimplemented in RWTInputStreamLockImp< RWCharInputStream, RWFilteredCharInputStreamImp >.

virtual char RWCharInputStreamImp::read ( )
pure virtual
virtual RWSize RWCharInputStreamImp::read ( char *  charArray,
RWSize  numChars 
)
pure virtual

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

Parameters
charArrayA pointer to the first element of the array.
numCharsThe number of narrow characters to be read from the stream.

Implemented in RWTInputStreamLockImp< RWCharInputStream, RWFilteredCharInputStreamImp >, RWCharFromStreambufInputStreamImp, and RWFilteredCharInputStreamImp.

virtual void RWCharInputStreamImp::readStringUntil ( RWCString string,
char  delim 
)
pure virtual

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
stringA string object receiving the narrow character(s) extracted from the stream.
delimThe narrow character used as a delimiter.

Implemented in RWBufferedCharInputStreamImp, RWCharFromStreambufInputStreamImp, RWFilteredCharInputStreamImp, and RWSynchronizedCharInputStreamImp.

virtual RWSize RWCharInputStreamImp::readUntil ( char *  charArray,
RWSize  maxSize,
char  delim 
)
pure virtual

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
charArrayA pointer to the array receiving the narrow character(s) extracted from the stream.
maxSizeThe maximum number of narrow character(s) to be read.
delimThe narrow character value used as a delimiter.

Implemented in RWCharFromStreambufInputStreamImp, RWFilteredCharInputStreamImp, and RWSynchronizedCharInputStreamImp.

virtual void RWCharInputStreamImp::release ( )
inlinevirtual

Releases the synchronization mechanism provided by a stream concrete implementation.

Reimplemented in RWTInputStreamLockImp< RWCharInputStream, RWFilteredCharInputStreamImp >.

Copyright © 2023 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved.